-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(typedoc): Typedoc Indexing #896
Conversation
✅ Deploy Preview for maci-typedoc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I would suggest to .gitignore them - anyways they will be generated on the gh-pages branch upon deployment |
88bfae9
to
91c915a
Compare
04586fb
to
5700f1f
Compare
Hmmm so is the takeaway that
What's the current name - is it the same as the directory slug? If so, I noticed the same issue in (#870 (comment))
Do we need an index page? Happy to write our own if so - I can add a quick explainer. Better yet, why don't you take a quick swing at a description for it (e.g. these API docs are generated using TypeDoc for xyz packages of the repo).
I agree with @ctrlc03 I think we can gitignore these since they're autogenerated. |
8455b1d
to
3101a60
Compare
Currently use the modules.md page as the index page, if anyone wants to add any description on the page, just leave a comment :) or it could be an independent issue~~
Yes it's actually the same question. Now it's automatically generated as just |
d133620
to
9cf10f9
Compare
a27964a
to
633666f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, thanks for taking care of this. Left just a couple of minor comments
versioned_docs/version-v1.x/solidity-docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add the typedoc folder directly as someone might generate the docs but not actually run the build script inside the website folder
@@ -1,39 +1,13 @@ | |||
import fs from "fs"; | |||
import path from "path"; | |||
|
|||
import { copyDirectory } from "./utils"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat
website/src/scripts/setupTypedoc.ts
Outdated
try { | ||
const versionContent = fs.readFileSync(versionFile, "utf8"); | ||
if (versionContent) { | ||
const versionContentJson: string[] = JSON.parse(versionContent) as string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove : string[]
as it's redundant (given you cast using as string[]
)
} | ||
const TYPEDOC_DIR = path.resolve(__dirname, "../../typedoc"); | ||
|
||
function updateMentionFiles(dirName: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add some documentation to this function please?
c14e269
to
14d5477
Compare
34075d4
to
1f7a509
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, thank you!!
@@ -6,7 +6,7 @@ | |||
"license": "MIT", | |||
"scripts": { | |||
"bootstrap": "lerna bootstrap", | |||
"build": "lerna run build", | |||
"build": "lerna run build --ignore=website", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ignore website here? I suppose generally not needed when building MACI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we could only run npm run typedoc
in root folder only after all the packages are built (instead of website). The npm run build
command in website/
would do things to Typedocs and put them in the versioned_docs/v1.x/
folder. Which means the runnable order of the script should be
- build all packages
- build typedoc and soliditydocs
- build website
Of course we could ignore the setup-typedoc
and setup-soliditydocs
command for the first build while running lerna run build
command, and build typedocs and soliditydocs, and build the website again; but I don't think we should build the website twice. That's why I ignore the website package for the first build.
@kittybest agreed - do you mind creating an issue to capture this? Nice work on the PR! |
Description
Try the package docusaurus-plugin-typedoc at the beginning, it could automatically generate markdown files for typedocs, and put them inside
doc/
folder, which is default for the Next version document in Docusaurus. Also the sidebar will also be auto-generated.However, we will need to do something before we actually start or build the docusaurus:
README.md
(which should be the index page of typedoc) to github links. (currently we are doing it in thesetupTypedoc.ts
, by replacing the route in html file ➡️maci/website/src/scripts/setupTypedoc.ts
Line 38 in 88bfae9
docs/
is not the actual folder we put our documents, so will also need to move or copy the wholetypedoc/
folder toversioned_docs/v1.x/
.It's hard to split the command in docusaurus-plugin-typedoc, so I instead, tried to use only typedoc-plugin-markdown. I put the scripts doing the above 2 steps in the
setupTypedoc.ts
file.But there's still a problem, that the sidebar name is not setup as Typedoc. I will fix it.
Also wanna ask that the if we wanna auto-generate the index page of typedoc from the
README.md
? or we wanna write our own?Last is that should we put the generated markdown files in the repo instead of ignoring them?