diff options
author | Graham Christensen <graham@grahamc.com> | 2018-05-01 19:39:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-01 19:39:31 -0400 |
commit | 4f5a995b0306951726eeea43d64acb0142e816ea (patch) | |
tree | 8f6fbdb9d1971fa43855842dbfb31c487aa6f8b2 /nixos | |
parent | 5b8c550a863a04d313b3e5ea07861cfc8d2571d8 (diff) | |
parent | 374a3bdf5b014d84b6ea57e80af52c5bc2d73f35 (diff) | |
download | nixpkgs-4f5a995b0306951726eeea43d64acb0142e816ea.tar nixpkgs-4f5a995b0306951726eeea43d64acb0142e816ea.tar.gz nixpkgs-4f5a995b0306951726eeea43d64acb0142e816ea.tar.bz2 nixpkgs-4f5a995b0306951726eeea43d64acb0142e816ea.tar.lz nixpkgs-4f5a995b0306951726eeea43d64acb0142e816ea.tar.xz nixpkgs-4f5a995b0306951726eeea43d64acb0142e816ea.tar.zst nixpkgs-4f5a995b0306951726eeea43d64acb0142e816ea.zip |
Merge pull request #39786 from grahamc/format-nixpkgs-docs-target
nixpkgs doc: add format Make target
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/Makefile | 20 | ||||
-rw-r--r-- | nixos/doc/manual/shell.nix | 8 | ||||
-rw-r--r-- | nixos/doc/xmlformat.conf | 72 |
3 files changed, 98 insertions, 2 deletions
diff --git a/nixos/doc/manual/Makefile b/nixos/doc/manual/Makefile index b15fbaa270f..4993976ae57 100644 --- a/nixos/doc/manual/Makefile +++ b/nixos/doc/manual/Makefile @@ -1,6 +1,22 @@ -debug: +.PHONY: all +all: manual-combined.xml format + +.PHONY: debug +debug: generated manual-combined.xml + +manual-combined.xml: generated *.xml + rm ./manual-combined.xml nix-shell --packages xmloscopy \ - --run 'xmloscopy --docbook5 ./manual.xml ./manual-combined.xml' + --run "xmloscopy --docbook5 ./manual.xml ./manual-combined.xml" + +.PHONY: format +format: + find . -iname '*.xml' -type f -print0 | xargs -0 -I{} -n1 \ + xmlformat --config-file "../xmlformat.conf" -i {} + +.PHONY: clean +clean: + rm -f manual-combined.xml generated generated: ./options-to-docbook.xsl nix-build ../../release.nix \ diff --git a/nixos/doc/manual/shell.nix b/nixos/doc/manual/shell.nix new file mode 100644 index 00000000000..7f8422b4ec1 --- /dev/null +++ b/nixos/doc/manual/shell.nix @@ -0,0 +1,8 @@ +let + pkgs = import ../../.. { }; +in +pkgs.mkShell { + name = "nixos-manual"; + + buildInputs = with pkgs; [ xmlformat jing xmloscopy ]; +} diff --git a/nixos/doc/xmlformat.conf b/nixos/doc/xmlformat.conf new file mode 100644 index 00000000000..50255857b24 --- /dev/null +++ b/nixos/doc/xmlformat.conf @@ -0,0 +1,72 @@ +# +# DocBook Configuration file for "xmlformat" +# see http://www.kitebird.com/software/xmlformat/ +# 10 Sept. 2004 +# + +# Only block elements +ackno address appendix article biblioentry bibliography bibliomixed \ +biblioset blockquote book bridgehead callout calloutlist caption caution \ +chapter chapterinfo classsynopsis cmdsynopsis colophon constraintdef \ +constructorsynopsis dedication destructorsynopsis entry epigraph equation example \ +figure formalpara funcsynopsis glossary glossdef glossdiv glossentry glosslist \ +glosssee glossseealso graphic graphicco highlights imageobjectco important \ +index indexdiv indexentry indexinfo info informalequation informalexample \ +informalfigure informaltable legalnotice literallayout lot lotentry mediaobject \ +mediaobjectco msgmain msgset note orderedlist para part preface primaryie \ +procedure qandadiv qandaentry qandaset refentry refentrytitle reference \ +refnamediv refsect1 refsect2 refsect3 refsection revhistory screenshot sect1 \ +sect2 sect3 sect4 sect5 section seglistitem set setindex sidebar simpara \ +simplesect step substeps synopfragment synopsis table term title \ +toc variablelist varlistentry warning itemizedlist listitem \ +footnote colspec partintro row simplelist subtitle tbody tgroup thead tip + format block + normalize no + + +#appendix bibliography chapter glossary preface reference +# element-break 3 + +sect1 section + element-break 2 + + +# +para abstract + format block + entry-break 1 + exit-break 1 + normalize yes + wrap-length 79 + +title + format block + normalize = yes + entry-break = 0 + exit-break = 0 + +# Inline elements +abbrev accel acronym action application citation citebiblioid citerefentry citetitle \ +classname co code command computeroutput constant country database date email emphasis \ +envar errorcode errorname errortext errortype exceptionname fax filename \ +firstname firstterm footnoteref foreignphrase funcdef funcparams function \ +glossterm group guibutton guiicon guilabel guimenu guimenuitem guisubmenu \ +hardware holder honorific indexterm inlineequation inlinegraphic inlinemediaobject \ +interface interfacename \ +keycap keycode keycombo keysym lineage link literal manvolnum markup medialabel \ +menuchoice methodname methodparam modifier mousebutton olink ooclass ooexception \ +oointerface option optional otheraddr othername package paramdef parameter personname \ +phrase pob postcode productname prompt property quote refpurpose replaceable \ +returnvalue revnumber sgmltag state street structfield structname subscript \ +superscript surname symbol systemitem token trademark type ulink userinput \ +uri varargs varname void wordasword xref year mathphrase member tag + format inline + +programlisting screen + format verbatim + entry-break = 0 + exit-break = 0 + + +#term +# format inline |