dmy / elm-doc-preview

Elm offline documentation previewer
https://www.npmjs.com/package/elm-doc-preview
Other
128 stars 15 forks source link

modules not shown #44

Open jxxcarlson opened 3 years ago

jxxcarlson commented 3 years ago

Hi, I've been running elm-doc-preview on this project. The READEM.md file shows up, but no documentation for modules -- they are not listed in the usual place on the right. Attached is my elm.json file, and below that is the output edp -d. Thanks!

{
    "type": "package",
    "name": "jxxcarlson/minilatex-b",
    "summary": "Compile MiniLaTeX to Html",
    "license": "MIT",
    "version": "1.0.0",
    "exposed-modules": [
        "Compiler.LaTeXData"
    ],
    "elm-version": "0.19.0 <= v < 0.20.0",
    "dependencies": {
        "elm/core": "1.0.0 <= v < 2.0.0",
        "elm/html": "1.0.0 <= v < 2.0.0",
        "elm/json": "1.1.3 <= v < 2.0.0",
        "elm/parser": "1.1.0 <= v < 2.0.0",
        "elm-community/list-extra": "8.3.0 <= v < 9.0.0",
        "elm-community/maybe-extra": "5.2.0 <= v < 6.0.0",
        "elm-explorations/test": "1.2.2 <= v < 2.0.0",
        "folkertdev/elm-paragraph": "1.0.0 <= v < 2.0.0"
    },
    "test-dependencies": {}
}

Terminal session:

➜  minilatex-b git:(master) edp -d
elm-doc-preview 5.0.5 using elm 0.19.1
Previewing jxxcarlson/minilatex-b 1.0.0 from /Users/carlson/dev/brilliant/minilatex-b
Browse <http://localhost:8000> to see your documentation
  |> watching package
{
  '/Users/carlson/dev/brilliant/minilatex-b': [ 'README.md', 'elm-tooling.json', 'elm.json' ],
  '/Users/carlson/dev/brilliant/minilatex-b/src': [ 'CommandInterpreter.elm', 'Utility.elm' ],
  '/Users/carlson/dev/brilliant/minilatex-b/src/Render': [ 'LaTeXState.elm', 'Render.elm' ],
  '/Users/carlson/dev/brilliant/minilatex-b/src/Parser': [
    'Block.elm',
    'Document.elm',
    'Expression.elm',
    'Helpers.elm',
    'Parser.elm',
    'Problem.elm',
    'TestData.elm',
    'TestHelper.elm',
    'TextCursor.elm'
  ],
  '/Users/carlson/dev/brilliant/minilatex-b/src/Compiler': [ 'Differ.elm', 'GenericDiffer.elm', 'LaTeXData.elm' ]
}
  |> ::1 connected
  |> building /Users/carlson/dev/brilliant/minilatex-b documentation
  |> generating /var/folders/ml/vl09g4313rb1jd6y9zvcd6200000gn/T/elm-docs-23433a7OntyQNkWYi.json documentation
rlefevre commented 3 years ago

Error should be displayed in the browser, but in case they are not, could you try running last version (5.0.5) with -o docs.json option? This should display errors in the terminal.

jxxcarlson commented 3 years ago

On Mar 8, 2021, at 3:09 AM, Rémi Lefèvre notifications@github.com wrote:

Error should be displayed in the browser, but in case they are not, could you try running last version (5.0.5) with -o docs.json option? This should display errors in the terminal.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dmy/elm-doc-preview/issues/44#issuecomment-792561154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFGANZ3XQLZIFFEN7KGXU3TCSA3LANCNFSM4YYTYXSA.

Hi, here is what I get:

➜  minilatex-b git:(master) edp --version
5.0.5

➜  minilatex-b git:(master) edp -o docs.json
elm-doc-preview 5.0.5 using elm 0.19.1
Previewing jxxcarlson/minilatex-b 1.0.0 from /Users/carlson/dev/brilliant/minilatex-b
  |> building /Users/carlson/dev/brilliant/minilatex-b documentation
SyntaxError: Unexpected token n in JSON at position 1370
  |> writing documentation into docs.json
failed to build project documentation

I think the below is not relevant, but in any case, it is my elm.json

{
    "type": "package",
    "name": "jxxcarlson/minilatex-b",
    "summary": "Compile MiniLaTeX to Html",
    "license": "MIT",
    "version": "1.0.0",
    "exposed-modules": [
        "MiniLaTeX", "Compiler.GenericDiffer", "Compiler.Differ", "Parser.Block"
    ],
    "elm-version": "0.19.0 <= v < 0.20.0",
    "dependencies": {
        "elm/browser": "1.0.2 <= v < 2.0.0",
        "elm/core": "1.0.0 <= v < 2.0.0",
        "elm/html": "1.0.0 <= v < 2.0.0",
        "elm/json": "1.1.3 <= v < 2.0.0",
        "elm/parser": "1.1.0 <= v < 2.0.0",
        "elm-community/list-extra": "8.3.0 <= v < 9.0.0",
        "elm-community/maybe-extra": "5.2.0 <= v < 6.0.0",
        "elm-explorations/test": "1.2.2 <= v < 2.0.0",
        "folkertdev/elm-paragraph": "1.0.0 <= v < 2.0.0",
        "mdgriffith/elm-ui": "1.1.8 <= v < 2.0.0"
    },
    "test-dependencies": {}
}
rlefevre commented 3 years ago

With --debug (or -d) option, the build directory is kept (here /Users/carlson/dev/brilliant/minilatex-b), so you can go inside and run elm make --docs=docs.json manually to see the error.

Here, you problem is:

-- DOCS MISTAKE --------------------------------- src/Compiler/GenericDiffer.elm

I do not see `diff` in your module documentation, but it is in your `exposing`
list:

1| module Compiler.GenericDiffer exposing (DiffRecord, diff)
                                                       ^^^^
Add a line like `@docs diff` to your module documentation!

Note: See <https://elm-lang.org/0.19.1/docs> for more guidance on writing high
quality docs.

I will check why the error is not displayed by elm-doc-preview.

rlefevre commented 3 years ago

The error is not displayed by elm-doc-preview in the browser because you are missing a README.md. Just add at least an empty README.md and you should see the errors.

This is not the expected behavior though, the error should be displayed even without a README.

jxxcarlson commented 3 years ago

Hmm … that’s odd, I have a README.md at root of the repo (see below). Is neat not where it should be?

➜  minilatex-b git:(master) tree -L 1
├── README.md
├── app
├── benchmarks
├── elm-stuff
├── elm-tooling.json
├── elm.json
├── node_modules
├── package-lock.json
├── package.json
├── scripts
├── scripts.yaml
├── src
└── tests

On Mar 8, 2021, at 7:44 AM, Rémi Lefèvre notifications@github.com wrote:

The error is not displayed by elm-doc-preview in the browser because you are missing a README.md. Just add at least an empty README.md and you should see the errors.

This is not the expected behavior though, the error should be displayed even without a README.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dmy/elm-doc-preview/issues/44#issuecomment-792731221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFGAN2MD3NHGHKF37O2AH3TCTBC7ANCNFSM4YYTYXSA.

rlefevre commented 3 years ago

It should be at the same place as the elm-application.json, so in app sub-directory.

jxxcarlson commented 3 years ago

I used elm make --docs=docs.json as you suggested to find and correct errors.

The docs came up this time.

Thanks!

On Mar 8, 2021, at 8:00 AM, Rémi Lefèvre notifications@github.com wrote:

It should be at the same place as the elm-application.json.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dmy/elm-doc-preview/issues/44#issuecomment-792739349, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFGAN3DAQABBHH7TVWJBPTTCTC7HANCNFSM4YYTYXSA.