DocumenterVitepress.jl icon indicating copy to clipboard operation
DocumenterVitepress.jl copied to clipboard

add arg to specify the documentation's folder, in case is not docs

Open lazarusA opened this issue 1 year ago • 18 comments

lazarusA avatar Mar 31 '24 21:03 lazarusA

Is this an issue that has been encountered? I would have thought that the relative paths were sufficient, especially since I only ever go through doc.meta.build...

asinghvi17 avatar Mar 31 '24 21:03 asinghvi17

not anymore, things work for now... but, I need to provide explicitly the config.mts file, otherwise fails.

https://github.com/lazarusA/julia/tree/la/docs

Edit: more issues are showing up, but mostly formatting. I will report back later on those.

lazarusA avatar Mar 31 '24 22:03 lazarusA

Aha! Yeah the Julia docs would be great to test out the formatting :D

asinghvi17 avatar Mar 31 '24 22:03 asinghvi17

@lazarusA Everything seems to be joinpath(doc.user.build, settings.md_output_path, ...), no explicit references to a docs folder. What exactly needs to be done here?

The package.json file does hardcode .documenter as the md_output_path or so, but that seems unrelated to this issue?

asinghvi17 avatar Mar 31 '24 22:03 asinghvi17

just by changing the template reading the docs and looking for information is so much better. We should try to push this whole thing a little bit more :D

lazarusA avatar Mar 31 '24 22:03 lazarusA

yeah. You are right.

The original issue was that, if you don't provide any .json file, then it tries to copy do docs/, which it might not exist. But, things work know, maybe I should try to remove again the .vitepress folder from src and test again.

lazarusA avatar Mar 31 '24 22:03 lazarusA

Huh, it should never do that in theory. Maybe Documenter was run in the wrong folder? That's the only thing I can think of...

asinghvi17 avatar Mar 31 '24 22:03 asinghvi17

Ok, now I had removed the .vitepress folder, the build works, but it looks like it cannot install the proper node dependencies:

> docs:dev
> vitepress dev _build/html/en/.documenter

failed to start server. error:
Error: You need to install `markdown-it-mathjax3` to use math support.
    at createMarkdownRenderer (file:///Users/lalonso/node_modules/vitepress/dist/node/serve-BTRXZ1g2.js:37405:13)
    at async localSearchPlugin (file:///Users/lalonso/node_modules/vitepress/dist/node/serve-BTRXZ1g2.js:41795:14)
    at async createVitePressPlugin (file:///Users/lalonso/node_modules/vitepress/dist/node/serve-BTRXZ1g2.js:42426:5)
    at async createServer (file:///Users/lalonso/node_modules/vitepress/dist/node/serve-BTRXZ1g2.js:63811:14)

commenting out those lines for now 😄 .

lazarusA avatar Mar 31 '24 22:03 lazarusA

Does https://github.com/LuxDL/DocumenterVitepress.jl/pull/91 fix it?

asinghvi17 avatar Mar 31 '24 23:03 asinghvi17

no, it does not. Summary:

  • For some reason extra Node dependencies are not being install.
  • the following syntax in the config.mts menu names is not valid: 'Julia's example': (the extra ') there was a way, don't remember now.
  • A lot broken id @ast things.

if you want to see what it works a the moment even this issue comment out some lines

import { defineConfig } from 'vitepress'
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
// import mathjax3 from "markdown-it-mathjax3";
// import footnote from "markdown-it-footnote";

// https://vitepress.dev/reference/site-config
export default defineConfig({
  base: '/docs.julialang.org.git/',// TODO: replace this in makedocs!
  title: 'The Julia Language',
  description: "A VitePress Site",
  lastUpdated: true,
  cleanUrls: true,
  outDir: '../final_site', // This is required for MarkdownVitepress to work correctly...
  
  ignoreDeadLinks: true,

  markdown: {
    math: false,
    config(md) {
      md.use(tabsMarkdownPlugin)
      // md.use(mathjax3),
      // md.use(footnote)
    },
.
.
.

overall, I'm pretty happy with the outcome.

lazarusA avatar Mar 31 '24 23:03 lazarusA

after cloning the repo (https://github.com/lazarusA/julia/tree/la/docs) simply doing first in the root directory:

make docs # this will build the docs.

then

cd doc

and the usual

npm run docs:dev

lazarusA avatar Mar 31 '24 23:03 lazarusA

ERROR: LoadError: expected package Documenter [e30172f5] to be registered

Just tried to build it, got most of the way through and then it started building HTML documentation and gave me this error.

asinghvi17 avatar Apr 01 '24 00:04 asinghvi17

Ah the error here was that the path in package.json was incorrect.

asinghvi17 avatar Apr 01 '24 00:04 asinghvi17

The language 'llvm' is not loaded, falling back to 'txt' for syntax highlighting. (x5)

The language 'fortran' is not loaded, falling back to 'txt' for syntax highlighting.

are probably dealbreakers for using the actual Julia docs for this, unless we manage to hack Vitepress to change its syntax highlighter to something which supports Fortran and LLVM :(

asinghvi17 avatar Apr 01 '24 00:04 asinghvi17

Ok. I kinda finish the Julia docs 👎🏻 . Solving https://github.com/LuxDL/DocumenterVitepress.jl/issues/101 might fix the last issue, only LibGit2 is failing and it looks related to a missing tag.

Also, I still had problems with the Node dependencies. I solved by

  1. Copying the package-lock.json into doc folder and then manually doing npm i. @asinghvi17 how did you solved this?
  2. For now, nav and sidebar are done manually.

You should see this:

Screenshot 2024-04-01 at 21 43 21 Screenshot 2024-04-01 at 21 46 04

lazarusA avatar Apr 01 '24 19:04 lazarusA

Whoa, that looks really cool!!

I'm hoping to tackle the sidebar + repl block issues today.

problems with the Node dependencies

I had none of these, it just worked for me...

asinghvi17 avatar Apr 01 '24 20:04 asinghvi17

Ah the error here was that the path in package.json was incorrect.

but, you did changed something? if I understood this correctly.

lazarusA avatar Apr 01 '24 20:04 lazarusA

Ah yeah I forgot :sweat_smile: I just changed the paths in the package.json to point to the cover. We should actually use npm run vitepress directly instead.

asinghvi17 avatar Apr 01 '24 20:04 asinghvi17