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

Documentation html output enhancements #7034

Closed
wants to merge 8 commits into from

Conversation

nmikhailov
Copy link
Contributor

See #4901

All themes are there, so you can test them out. Some of them don't play with nix nicely. (eg. some text is unreadable on http://nmikhailov.github.io/nixpkgs/sec-writing-modules.html).
Themes list & preview: https://highlightjs.org/static/demo/
Documentation preview: http://nmikhailov.github.io/nixpkgs

cc @domenkozar

@nmikhailov nmikhailov changed the title Highlight listings in manuals [WIP] Highlight listings in manuals Mar 27, 2015
@domenkozar
Copy link
Member

Since Nix/NixOS/Nixpkgs manuals are on white backgroud, I'd say we use github colors for now.

@nbp
Copy link
Member

nbp commented Mar 27, 2015

Also, do not highlight, or highlight properly output messages which are using asymmetric quotation marks.

http://nslqqq.github.io/nixpkgs/sec-configuration-syntax.html#sec-configuration-file

@nbp
Copy link
Member

nbp commented Mar 27, 2015

Same page, add support for multi-line strings.

  foo = ''
    text
  '';

@nmikhailov nmikhailov force-pushed the master branch 3 times, most recently from 10ddc8e to 78d3230 Compare March 28, 2015 11:27
@nmikhailov
Copy link
Contributor Author

@domenkozar , @nbp
Ok, I have set github theme, fixed highlighting and quotes.
Cleaned up, updated preview

@nmikhailov nmikhailov changed the title [WIP] Highlight listings in manuals Highlight listings in manuals Mar 28, 2015
@nmikhailov
Copy link
Contributor Author

Added selflinks to headers as described in #4965.
Set output mode to single-html as it more user friendly(also discussed in #4965)

@nmikhailov nmikhailov changed the title Highlight listings in manuals [WIP] Manual html output enhancements Mar 28, 2015
@nmikhailov nmikhailov changed the title [WIP] Manual html output enhancements [WIP] Documentation html output enhancements Mar 29, 2015
@nmikhailov nmikhailov changed the title [WIP] Documentation html output enhancements Documentation html output enhancements Mar 29, 2015
@domenkozar
Copy link
Member

+1, except one-page html (that probably needs a bit more discussion).

@nmikhailov
Copy link
Contributor Author

Personally, I don't see any benefit of multi-page html and agree with @spwhitt, @wmertens and @chaoflow. But now I see that docs were previously single-paged and were splitted afterwards in 81f2749. Reasons for that are not clear for me.

@@ -66,7 +66,7 @@ instance, if two modules define
<command>nixos-rebuild</command> will give an error:

<screen>
The unique option `services.httpd.adminAddr' is defined multiple times, in `/etc/nixos/httpd.nix' and `/etc/nixos/configuration.nix'.
The unique option 'services.httpd.adminAddr' is defined multiple times, in '/etc/nixos/httpd.nix' and '/etc/nixos/configuration.nix'.
Copy link
Member

Choose a reason for hiding this comment

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

This is incorrect, because the original quotes are the actual output of that command. So please don't change the quoting style.

@edolstra
Copy link
Member

edolstra commented Apr 1, 2015

Where does highlight.pack.js come from, and how is it (re)generated?

@edolstra
Copy link
Member

edolstra commented Apr 1, 2015

Attribute paths are not highlighted correctly - only the last element is coloured (e.g. in networking.hostName, only hostName is coloured).

@nmikhailov
Copy link
Contributor Author

@edolstra i got it from https://highlightjs.org/download/ , Custom packages section. Building it will require nodejs(http://highlightjs.readthedocs.org/en/latest/building-testing.html).

@domenkozar
Copy link
Member

That's how I wrote the highlighter for highlight.js - we can change that for the next version if wanted. I find it nice to highlight only the last option (took the idea from vim highlighter).

See highlightjs/highlight.js#399

@nmikhailov
Copy link
Contributor Author

I updated asymmetric quotes thing, these snippets are now ignored.

@nmikhailov
Copy link
Contributor Author

What do you think about highlightjs script itself though? Wouldn't it be better to depend on nodejs and generate&minify it on the fly?

@domenkozar
Copy link
Member

Why would we? We only need to update if Nix highlighter changes. I'd only add docs to describe how to update highlight.js

@nmikhailov
Copy link
Contributor Author

Well, i don't know, but it seems to be nice thing to do, and its in nix spirit. We use nix to build docs anyway. Now its simpler, but a bit ugly in my opinion. Also that way it will be kinda self documented.

@nmikhailov
Copy link
Contributor Author

I separated options and manual as discussed in #7607

@domenkozar domenkozar added this to the 15.06 milestone May 2, 2015
@domenkozar domenkozar modified the milestones: 16.03, 15.09 Sep 9, 2015
@nbp
Copy link
Member

nbp commented Nov 16, 2015

@domenkozar @nmikhailov Can we rebase this work and get it merged?

@domenkozar
Copy link
Member

Yeah I'm planning to do that for 16.03 (but it's low priority)

@domenkozar domenkozar modified the milestones: 16.09, 16.03 Apr 1, 2016
@domenkozar domenkozar modified the milestones: 17.03, 16.09 Oct 24, 2016
@globin globin modified the milestones: 17.09, 17.03 Mar 20, 2017
@grahamc
Copy link
Member

grahamc commented Mar 27, 2018

It took exactly three years, but I've merged a PR adding syntax highlighting. Thank you for providing the base on which I implemented #37901.

@grahamc grahamc closed this Mar 27, 2018
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