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

Make Nixpkgs docs less frustrating to hack on #37749

Merged
merged 7 commits into from Mar 26, 2018

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Mar 25, 2018

Motivation for this change

Editing the docs is frustrating!

try it: nix-shell in the doc dir, break the XML, and run xmloscopy --docbook5 manual.xml manual-full.xml.

cc @zimbatm @domenkozar @garbas @Mic92 @makefu

@Mic92
Copy link
Member

Mic92 commented Mar 25, 2018

Looks good to me. Only running make a second time results in the following error:

$ make
make
make: Circular manual-full.xml <- manual-full.xml dependency dropped.
jing "$RNG" manual-full.xml
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
mkdir -p out/html
xsltproc $xsltFlags \
        --nonet --xinclude \
        --output out/html/index.html \
        "$XSL/docbook/xhtml/docbook.xsl" \
        ./manual-full.xml
cp ./style.css out/html/style.css
mkdir -p out/html/images/callouts
cp "$XSL/docbook/images/callouts/"*.gif out/html/images/callouts/
cp: cannot create regular file 'out/html/images/callouts/10.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/11.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/12.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/13.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/14.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/15.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/1.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/2.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/3.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/4.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/5.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/6.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/7.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/8.gif': Permission denied
cp: cannot create regular file 'out/html/images/callouts/9.gif': Permission denied
make: *** [Makefile:19: out/html/index.html] Error 1

@Mic92
Copy link
Member

Mic92 commented Mar 25, 2018

Also generated files/directories should be added to .gitignore.

@grahamc
Copy link
Member Author

grahamc commented Mar 25, 2018

Oops, I forgot to verify that flow and the .gitignore after I ported over the image copying. Fixed!

The generated files should already be ignored?

@grahamc
Copy link
Member Author

grahamc commented Mar 25, 2018

Note after this I want to do it to NixOS docs, too, which desperately need a better debug flow.

@grahamc
Copy link
Member Author

grahamc commented Mar 25, 2018

I'm going to mere this in about 24 hours unless there are outstanding problems.

Copy link
Contributor

@makefu makefu left a comment

Choose a reason for hiding this comment

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

great improvement, thanks!

</screen>

<para>If you experience problems, run <command>xmloscopy --docbook5
./manual.xml ./manual-full.xml</command> inside the nix-shell to help
Copy link
Member

Choose a reason for hiding this comment

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

small improvement idea: add a make debug shortcut command for that scenario

Copy link
Member Author

Choose a reason for hiding this comment

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

That would run like nix-shell --run 'xmloscopy ...'. Does that sound right?

Copy link
Member

Choose a reason for hiding this comment

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

Do the other make targets assume a nix-shell environment?

Copy link
Member Author

Choose a reason for hiding this comment

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

its complicated because this is the only one that won't work with the default.nix, where the makefile will be called automatically.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to merge, we can improve this in a separate commit :)

@grahamc grahamc merged commit 37f50c1 into NixOS:master Mar 26, 2018
@grahamc grahamc deleted the nixpkgs-docs branch March 26, 2018 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants