Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixos-homepage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3e53706fdaa9
Choose a base ref
...
head repository: NixOS/nixos-homepage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 30ae47fcf869
Choose a head ref
  • 6 commits
  • 2 files changed
  • 2 contributors

Commits on Apr 17, 2018

  1. Finishes fix fo #89, <link> → <a>.

    To verify:
    
    Search using the <input> for `<link`.
    
    An example option with link: `boot.initrd.luks.mitigateDMAAttacks`
    samueldr committed Apr 17, 2018
    Copy the full SHA
    146ea99 View commit details
  2. Copy the full SHA
    8796fac View commit details
  3. Parses <filename>.

    samueldr committed Apr 17, 2018
    Copy the full SHA
    b0a88c1 View commit details
  4. Parses manpage references.

    samueldr committed Apr 17, 2018
    Copy the full SHA
    bedbfa5 View commit details
  5. Parses <important> in options page.

    See `virtualisation.virtualbox.host.enableHardening`
    samueldr committed Apr 17, 2018
    Copy the full SHA
    a3f184c View commit details

Commits on Apr 18, 2018

  1. Merge pull request #191 from samueldr/fix/xml-issues

    Fixes xml issues in description field for options.html
    edolstra authored Apr 18, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    30ae47f View commit details
Showing with 57 additions and 1 deletion.
  1. +8 −0 css/nixos-site.css
  2. +49 −1 nixos/options.tt
8 changes: 8 additions & 0 deletions css/nixos-site.css
Original file line number Diff line number Diff line change
@@ -282,6 +282,14 @@ div.search-details td.nix {
font-family: monospace;
}

#search-results .description.docbook p > .docbook-important {
margin-top: 0.5rem;
}

#search-results .description.docbook .docbook-important {
border-left: #F89406 solid 0.3rem;
padding-left: 0.5rem;
}

/* Manual. */

50 changes: 49 additions & 1 deletion nixos/options.tt
Original file line number Diff line number Diff line change
@@ -270,8 +270,56 @@ function showOption() {

var details = $('#details-template').clone().removeAttr('id').show();

// Parses the XML fragment
var x = $.parseXML('<xml xmlns:xlink="http://www.w3.org/1999/xlink"><para>' + opt.description + '</para></xml>');
$('.description', details).empty().append($(x).text());

// For each xlink, replace with equivalent `<a>`.
$(x).find("link").each(function (i, el) {
var link = $(el).attr("xlink:href");
var inner = el.innerHTML;
if (inner === "" || !inner) {
inner = link;
}
$($("<a></a>").html(inner).attr("href", link)).replaceAll(el);
});

// For each [filename], replace with equivalent `<tt>`.
$(x).find("filename").each(function (i, el) {
var inner = el.innerHTML;
$($("<tt></tt>").html(inner)).replaceAll(el);
});

// For each [option, literal], replace with equivalent `<code>`.
$(x).find("option, literal").each(function (i, el) {
var inner = el.innerHTML;
$($("<code></code>").html(inner)).replaceAll(el);
});

// Fixes manpage references.
$(x).find("citerefentry manvolnum").each(function (i, el) {
var el = $(el).parent();
var title = el.children("refentrytitle")[0].innerHTML;
var volnum = el.children("manvolnum")[0].innerHTML;
$($("<tt class='man_page'></tt>").html(title + "(" + volnum + ")")).replaceAll(el);
});

// Since `<para>` can be inside a `<para>`, we have to do this ugly loop.
// Well, unless someone else has something more elegant.
var paras = []
while ((paras = $(x).find("para")).length > 0) {
paras.each(function (i, el) {
var inner = el.innerHTML;
$($("<p></p>").html(inner)).replaceAll(el);
});
}

// For each [option, literal], replace with equivalent `<code>`.
$(x).find("important").each(function (i, el) {
var inner = el.innerHTML;
$($("<div class='docbook-important'></div>").html(inner)).replaceAll(el);
});

$('.description', details).empty().append($(x).contents());

if ('default' in opt)
$('.default', details).empty().addClass('pre').text(ppNix('', opt.default));