Docbook Editor Configuration: Difference between revisions

imported>Mic92
simplify neovim configuration
imported>Samueldr
Adds minimalist guide to writing (validating) Docbook using IntelliJ IDEA
Line 41: Line 41:
])
])
</syntaxhighlight>
</syntaxhighlight>
== For IntelliJ IDEA (Community and Ultimate) ==
First off, the feature set for XML and Docbook editing is the same in both versions. Here's a neat one-liner to start the Community edition
<syntaxhighlight lang="commands">
nix-shell -p jetbrains.idea-community --run idea-community
</syntaxhighlight>
Then, open the <tt>doc/</tt> folder of the <tt>&lt;nixpkgs&gt;</tt> project. (Opening a file directly will not allow browsing the directory structure within the IDE.
[[File:Docbook-intellij-open.png]]
=== Adding the docbook schema ===
At the root of <tt>&lt;nixpkgs&gt;</tt>, run the following command. It will create a link to docbook, allowing (easier) use of the
xsd files. The symlink can be updated instead of having to change the full store path in the editor. The second command will print the full path to the docbook xsd.
<syntaxhighlight lang="commands">
nix-build -A docbook5 --out-link docbook
echo $PWD/docbook/share/xml/docbook-5.0/xsd/docbook.xsd
</syntaxhighlight>
Open <tt>manual.xml</tt>. After a short while, IntelliJ IDEA will realise it does not know about the schema.
[[File:Docbook-intellij-schema-error.png]]
Click on the red light bulb, then <em>Manually setup an external resource</em>.
[[File:Docbook-intellij-bulb-menu.png]]
Paste in the full path to the <tt>xsd</tt> file.
[[File:Docbook-intellij-full-path.png]]
After this is done, IntelliJ will validate.
[[File:Docbook-intellij-mistake.png]]