Skip to content
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

Fix daml-doc md #16475

Merged
merged 4 commits into from Mar 8, 2023
Merged

Fix daml-doc md #16475

merged 4 commits into from Mar 8, 2023

Conversation

samuel-williams-da
Copy link
Contributor

Resolves #16474
Relevant question: https://discuss.daml.com/t/markdown-referencing-html-in-generated-doc/6222

Simply switches the generated md files and hoogle db to use .md on internal global anchors, when run with format=md

@samuel-williams-da
Copy link
Contributor Author

Md fixes not tested, waiting on information for how to run hoogle with the generated file

@samuel-williams-da
Copy link
Contributor Author

Confirmed hoogle points to md file when format=md is used.

@akrmn
Copy link
Contributor

akrmn commented Mar 7, 2023

I don't know if this is common but I worry that someone might be generating the .md docs to then generate .html on their own pipeline; such a workflow would break, so I think this should be behind a new flag

@samuel-williams-da
Copy link
Contributor Author

Fair point, I can add a --doc-ext flag that defaults to html?

@samuel-williams-da
Copy link
Contributor Author

Seems like odd UX though to generate md docs and have it pointing to html, perhaps its worth somehow enquiring on whether people do this?

@samuel-williams-da
Copy link
Contributor Author

Alternatively, I may add a little warning note if you use format=md without doc-ext=md. Do you think thats reasonable?

@akrmn
Copy link
Contributor

akrmn commented Mar 7, 2023

yeah honestly I'm not sure what's the best for UX here. At least we don't seem to be using daml damlc docs to produce markdown in the DA repos (see search). The least disruptive would be to set --doc-ext=html by default, I think

@samuel-williams-da
Copy link
Contributor Author

Yeah I believe our own docs are generated by calling the internals directly

@samuel-williams-da
Copy link
Contributor Author

What do you think about the warning?

@akrmn
Copy link
Contributor

akrmn commented Mar 7, 2023

Also, note that the paths with .html appear unused in the rst codepath, see here

@akrmn
Copy link
Contributor

akrmn commented Mar 7, 2023

What do you think about the warning?
add a little warning note if you use format=md without doc-ext=md

hm yeah that sounds fine too

@samuel-williams-da
Copy link
Contributor Author

Do we consider format=rst and doc-ext defined an error, given it will have no effect?

@akrmn
Copy link
Contributor

akrmn commented Mar 8, 2023

Do we consider format=rst and doc-ext defined an error, given it will have no effect?

I think it's fine if it's just ignored in that case

@@ -151,7 +153,7 @@ documentation numProcessors = Damldoc
optOutputFormat =
option readOutputFormat $
metavar "FORMAT"
<> help "Output format. Valid format names: rst, md, markdown, html, hoogle, json (Default: markdown)."
<> help "Output format. Valid format names: rst, md, markdown, html, json (Default: markdown)."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for spotting this :)

@samuel-williams-da samuel-williams-da merged commit 81b90cf into main Mar 8, 2023
17 checks passed
@samuel-williams-da samuel-williams-da deleted the sw/fix-md-doc-links branch March 8, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix daml-doc md local files linking to html
2 participants