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

Add pandoc support back to rust script #349

Merged
merged 22 commits into from
Sep 14, 2021
Merged

Add pandoc support back to rust script #349

merged 22 commits into from
Sep 14, 2021

Conversation

ysndr
Copy link
Member

@ysndr ysndr commented Aug 26, 2021

Addressing #329

Pandoc support for descriptions was removed in #320 and now comes back to the rewrite

@ysndr
Copy link
Member Author

ysndr commented Aug 26, 2021

The changes from #329 could be added if the nixpkgs PR lands or we pin our nixpkgs to it

@github-actions
Copy link
Contributor

@github-actions github-actions bot temporarily deployed to pull request August 26, 2021 11:46 Inactive
@github-actions
Copy link
Contributor

@github-actions github-actions bot temporarily deployed to pull request August 26, 2021 13:06 Inactive
@github-actions
Copy link
Contributor

@github-actions github-actions bot temporarily deployed to pull request August 26, 2021 13:09 Inactive
@github-actions
Copy link
Contributor

@github-actions github-actions bot temporarily deployed to pull request August 26, 2021 13:22 Inactive
@jtojnar
Copy link
Member

jtojnar commented Sep 7, 2021

The nixpkgs PR has been merged.

@ysndr
Copy link
Member Author

ysndr commented Sep 7, 2021 via email

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

@github-actions github-actions bot temporarily deployed to pull request September 9, 2021 12:20 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

@github-actions github-actions bot temporarily deployed to pull request September 9, 2021 12:26 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 9, 2021 12:45 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

@github-actions github-actions bot temporarily deployed to pull request September 9, 2021 13:13 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

@github-actions github-actions bot temporarily deployed to pull request September 9, 2021 13:24 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

@github-actions github-actions bot temporarily deployed to pull request September 9, 2021 14:04 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

@github-actions github-actions bot temporarily deployed to pull request September 9, 2021 14:48 Inactive
@ysndr
Copy link
Member Author

ysndr commented Sep 10, 2021

Internal links show as ??? still
Styling runs through pandoc with corresponding performance hit

@jtojnar
Copy link
Member

jtojnar commented Sep 10, 2021

Yes, we did not fix the question marks yet. In the NixOS manual, we convert them back to xref tags and let DocBook resolve the chapter titles.

I think it should be possible to use manual’s olink database to get this information:

--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -159,7 +159,7 @@ let
     '';
 
 in rec {
-  inherit generatedSources;
+  inherit generatedSources olinkDB;
 
   inherit (optionsDoc) optionsJSON optionsXML optionsDocBook;
 
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -132,6 +132,7 @@ in rec {
   manualEpub = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualEpub));
   manpages = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manpages);
   manualGeneratedSources = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.generatedSources);
+  manualOlinkDB = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.olinkDB);
   options = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.optionsJSON)).x86_64-linux;
 
 

@ysndr
Copy link
Member Author

ysndr commented Sep 10, 2021

seems like pandoc hasnt implemented olinks support yet..

[ ] olink - A link that addresses its target indirectly, through an entity

https://github.com/jgm/pandoc/blob/37e30560ad546055d17f56df468cd35976b3218a/src/Text/Pandoc/Readers/DocBook.hs#L287

@ysndr
Copy link
Member Author

ysndr commented Sep 10, 2021

Is this at least the same state as prior to the rewrite?

@ncfavier
Copy link
Member

Yes, see #303.

@ysndr
Copy link
Member Author

ysndr commented Sep 10, 2021

Ok, I'd say we should restore that state first.
The further issue can be handled in a separate PR

@ysndr ysndr requested review from garbas and ncfavier September 10, 2021 12:03
@jtojnar
Copy link
Member

jtojnar commented Sep 10, 2021

Just to be clear, olinks are not used in the manual anyway. But the olink database created by docbook-xsl can be used to resolve xrefs as well. We would need to parse the olinkDB and replace the link texts in a lua script similar to https://github.com/NixOS/nixpkgs/blob/master/maintainers/scripts/doc/replace-xrefs-by-empty-links.py.

@ysndr
Copy link
Member Author

ysndr commented Sep 10, 2021

Ah I see
I think we can do that rather easily indeed, although I tried not to involve any xml parsing yet

@github-actions
Copy link
Contributor

@github-actions github-actions bot temporarily deployed to pull request September 14, 2021 07:48 Inactive
@ysndr ysndr merged commit 5cfde22 into main Sep 14, 2021
@ysndr ysndr deleted the pandoc-support branch September 14, 2021 07:49
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.

3 participants