Commit Graph

62 Commits

Author SHA1 Message Date
Peter Krempa
9f49f60aca docs: go: Add 'go-import' metadata via rST
The '.. meta::' rST directive allows adding header metadata. Move the
specific metadata from page.xsl into the individual files and pass them
through into the header from page.xsl.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-06-02 09:39:10 +02:00
Peter Krempa
54c1f31fda docs: page.xsl: Drop passhrough of <script> elements into header
No generated headers have inline javascript.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-06-02 09:39:10 +02:00
Peter Krempa
5ee27c37e6 docs: xsl: Simplify templating XSL
Wrap the auto-generated pages (API ref and hvsupport.html) in the proper
top level element similarly to what the pages generated from RST have to
remove the extra case when templating our web.

(Best viewed with 'git show -w')

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-05-18 10:06:51 +02:00
Peter Krempa
ef01df4a5c docs: Remove XSLT table of contents generator
The only remaining page was 'hvsupport.html' which is generated by
'scripts/hvsupport.py'. The script already has all the data to generate
the table of contents internally so we can remove the whole complicated
template.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-05-18 10:06:51 +02:00
Peter Krempa
65edcfd68f docs: XSL: Add source document name as custom data attribute for <html>
The html standard allows custom data attributes on any element in the
format of 'data-*' which are not interpreted. We can use it to embed the
name of the source document used to generate the page so that our
checker tools can use the friendly name.

https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15 12:38:45 +01:00
Daniel P. Berrangé
aeba13f24d docs: replace footer link to the bird site with mastodon
Since the takeover of the bird site, the bulk of tech people who want
a more friendly and inclusive media site have jumped over to Mastodon.
With its decentralized nature, there's no one replacement that captures
everything, but the fosstodon.org site is a topic relevant choice.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-15 11:04:30 +00:00
Peter Krempa
d049011697 docs: page.xsl: Fix link to 'mailing-lists' section
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
f843cdab7f docs: contact: Remove HTML anchors and adjust documents using them
Modify the name of the 'IRC discussion' paragraph to just 'IRC' so that
the links keep working and remove the raw HTML anchors.

Adjustment is needed for documents which were using the '#email' anchor
which has now become '#mailing-lists'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
8b60342f76 docs: Adapt to semantic tag usage of docutils-0.17 and later
Docutils-0.17 switched to using <main> instead of a <div
class='document'> and <section> instead of <div class='section'>.

To ensure that our pages still work we need to slightly adapt our XSL
stylesheet to select the <main> tag properly and adapt the CSS to also
select the 'section' element instead of a class and to apply to a <main>
tag with the appropriate names.

Docutils-0.17 also changed to use 'h2' for section heading instead of
'h1'.

Note the styles applied to the 'main' element with certain id can't be
made more universal by just applying to the id itself, as in certain
cases (e.g. 'documentation') we also have sections with that name. This
was previously ensured by also matching the 'document' class which would
make it equal to the 'main' element.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-04-13 13:02:06 +02:00
Peter Krempa
523f2de82e docs: page.xsl: Update anchor to the 'Code of conduct' paragraph
Use the anchor name as generated by rst2html.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-03-08 17:40:47 +01:00
Martin Kletzander
54814c87f3 docs: Fix template matching in page.xsl
Our last default template had a match of "node()" which incidentally matched
everything, including text nodes.  Since this has the same priority according to
the XSLT spec, section 5.5:

  https://www.w3.org/TR/1999/REC-xslt-19991116#conflict

this is an error.  Also according to the same spec section, the XSLT processor
may signal the error or pick the last rule.

This was uncovered with libxslt 1.1.35 which contains the following commit:

  b0074eeca3

which makes the build fail with:

  runtime error: file ../docs/page.xsl line 223 element element
  xsl:element: The effective name '' is not a valid QName.

because our last rule also matches text nodes and we are trying to extract the
node name out of them.

To fix this we change the match to "*" which only matches elements and not all
the nodes, and to avoid any possible errors with different XSLT processors we
also bump the priority of the match="text()" rule a little higher, just in case
someone needs to use an XSLT processor that chooses signalling the error instead
of the optional recovery.

https://bugs.gentoo.org/833586

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2022-02-21 16:11:19 +01:00
Andrea Bolognani
7163515aa9 docs: Move all CSS files to a subdirectory
This unclutters the top-level docs directory.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-01-04 15:47:27 +01:00
Daniel P. Berrangé
45f94690d2 docs: add go-import meta tags for new go modules
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-07-02 15:05:15 +01:00
Daniel P. Berrangé
b8e1521afb docs: point go imports to gitlab.com repos
The gitlab.com repos are the primary source, with libvirt.org just a
read-only mirror.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-07-02 15:05:15 +01:00
Peter Krempa
9fd2e78b96 docs: xsl: Unify stylability of main container element
page.xsl was adding '<div id="content">' wrapper for the content picked
up from the <body> element from the original input file. Optionally
class="$DOCNAME" was added for some documents taken from <body>.

Since docs generated from RST by docutils have a '<div class='document'
id='$DOCNAME>' we actually don't need an extra wrapper for them.

Additionally if we standardize on one of them we can use the same styles
for both. I've picked the latter because it makes more sense to use the
document name as 'id'.

This patch:
1) Modifies the XSL trasformation to add the wrapper only if it's not
   present.

2) Modifies the XSL transformation to use 'id' for document name and
   class='document' for the wrapper element.

3) Changes docs.html/index.html/hvsupport.html to use 'id' instead of
   'class' for document name.

4) Modifies the main stylesheet to keep styling the elements properly

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-11-16 14:04:04 +01:00
Peter Krempa
f988d4320d docs: xslt: Use 'Link' rather than 'Permalink' in header links
The anchors are based on the article or chapter headers, thus they are
not 100% permanent. Especially with pages generated from RST.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-11-16 14:04:03 +01:00
Peter Krempa
b9759291c5 docs: page.xsl: Improve generation of paragraph anchor links
Use the 'parent' axis to check whether the parent is a div with
class='section' rather than looking for 'toc-backref' anchor to see
whether to generate one of the headerlink alternatives. Both hare
docutils-specific thus apply to docs generated from RST documents.

This adds the links for pages generated from RST documents which don't
have a table of contents (and thus lack the 'toc-backref' anchors) and
thus fixes pages such as hacking.html and news.html to have reasonable
links which can be shared.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-11-02 14:14:07 +01:00
Ján Tomko
6fab37da59 Prefer https: everywhere where possible
Use https: links for websites that support them.

The URIs which are used as namespace identifiers
are left alone.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-09-01 21:58:46 +02:00
Daniel P. Berrangé
08376431b4 docs: fix libvirt go-import metadata in pages and links in 404 page
The meson conversion lost the <meta> tags providing the go-import,
because the "$pagename" variable lost the .html suffix. Rather
than fix that, just change to using "$pagesrc" instead, as it is a
better fit.

The 404 page also needs to use absolute links to work correctly for
pages in sub-folders.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-04 17:06:33 +01:00
Peter Krempa
862cf2ace4 docs: build: Use proper path to file in 'contribute' link
NEWS.rst is based in the root of the repository and 'hvsupport.html'
doesn't have a backing file which can be edited since it's fully
generated. Our 'contribute -> edit this page' link on the bottom of the
page is wrong in those cases.

Fix it by adding the contribute section only when there's a source and
base the 'source' of a html file in the root of the repository.

Along with that we need to modify the scripts/meson-html-gen.py script
to accept optional 'pagesrc' and the XSL template to skip the
'contribute' section when we don't have a source.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-08-03 18:41:11 +02:00
Daniel P. Berrangé
10ae8eb59c docs: add 'edit this page' link to footer of every page
To encourage contributors to make changes to the main website, add a
footer link to every page which links to the corresponding source file
in git. With gitlab, they are able to edit content directly in the web
browser and then submit a merge request. This gives a way to contribute
content that is arguably easier than our wiki which requires manual
account creation, while this will also benefit from maintainer review.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-04-09 12:01:49 +01:00
Daniel P. Berrangé
201156ec6e docs: add pages to support Go module package resolution
Currently the libvirt Go modules are accessed by applications using
their github repository URLs. This is undesirable as we don't want
applications to have a direct dependancy on a specific source repo
location. We want to enable applications to use the Go packages via
the libvirt.org namespace.

When you do "go get libvirt.org/libvirt-go", the Go client will do an
HTTPS request to that URL, and parse the HTML content to look for a
<meta> tag which tells it where to the find the GIT repository.

   https://golang.org/cmd/go/#hdr-Remote_import_paths

This adds two pages to support this Go module resolution. They are
not linked from anywhere as we don't expect users to actually look
at them. If someone does happen upon them, there's some boilerplate
text to send them off to godoc.org for API documentation.

Since the pages we're adding have a .html extension, we will also
use a small apache config tweak on the server

    RewriteEngine on
    RewriteRule ^/libvirt-go$ /libvirt-go.html [L]
    RewriteRule ^/libvirt-go-xml$ /libvirt-go-xml.html [L]

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-27 11:51:46 +00:00
Daniel P. Berrangé
a329bd0376 docs: generate permalinks correctly for rst2html output
The rst2html output generates the links for headings in a slightly
different way than we do for docs written in HTML, so we must match
another scenario when generating back links.

rst2html will also use <h1> tags for both the document title and
the first level of section titles, so we must expand the matching
to allow for this too.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-04 15:48:28 +00:00
Daniel P. Berrangé
8215da927a docs: adapt filling of <head> section for rst2html output
The HTML from rst2html doesn't have <h1> immediately under the <body>
tag, instead there is at least one <div> in between.

There are also many things added in the <head> section that we don't
want to have copied over, since our templating system already adds
suitable <head> elements.

We only need to copy the <script> to make index.html work.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-04 15:48:28 +00:00
Daniel P. Berrangé
eef089db78 docs: fix include of ACL permissions files
The XSL generator loads included HTML files relative to the source dir
but we need to tell it to load them from the build dir instead.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-11-22 11:14:20 +00:00
Daniel P. Berrangé
ec59a95a2c docs: add advanced search capabilities
Allow targetting the search scope to the website, wiki or mailing lists
only. When javascript is disabled this should gracefully fallback to
only searching the website.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-04-11 15:20:17 +01:00
Daniel P. Berrangé
97e743ac14 docs: move javascript logic into a standalone file
Instead of duplicating javascript in every single page, put it in a
standalone file which can be cached by the browser.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-04-11 15:20:17 +01:00
Cole Robinson
7c3927d288 docs: Use google sitesearch for website search
The website search is perpetually broken, has had XSS issues in the
past, and I suspect when it's working it's not as fast or capable as
a simple google site:libvirt.org search

Replace the <form> implementation with one that sends the user to
google.com with 'site:libvirt.org' appended to the search string

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-04-04 18:45:06 -04:00
Daniel P. Berrangé
27b6ca7d9c docs: remove Google+ link from page footer
Google is shutting down Google+, with no replacement, in the very near
future so we are losing the Libvirt community group there.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-03-07 11:46:16 +00:00
Andrea Bolognani
2f06f433ad docs: Fix indentation of inlined JavaScript snippet
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-02-19 17:32:20 +01:00
Daniel P. Berrange
7c956d42a2 docs: make website responsive for mobile devices
The website does not look good in a mobile device as the text is
far too small and the layout assumes a wide screen.

Make the style dynamically adapt based on viewport size, so a
mobile device gets a layout more suited to its dimensions,
also changing "Learn" to "Docs"

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-07 14:44:40 +01:00
Daniel P. Berrange
40cb5581c4 docs: add full set of "favicon" files to support modern clients
Use of the relation "shortcut" for a favicon was an Internet
Explorer only feature. Other browsers just require "icon".

The new icons & metadata are generated using

  https://realfavicongenerator.net/

which is user tested to work well across all modern clients

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-02 17:00:11 +01:00
Daniel P. Berrange
fe1b253e1b docs: explicitly declare pages as being UTF-8 format
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-02 17:00:11 +01:00
Daniel P. Berrange
b1c81567c7 docs: switch to using HTML5 doctype declaration
The HTML5 doctype is simply

  <!DOCTYPE html>

no DTD is present because HTML5 is no longer defined as an
extension of SGML.

XSL has no way to natively output a doctype without a public
or system identifier, so we have to use an <xsl:text> hack
instead.

See also

  https://dev.w3.org/html5/html-author/#doctype-declaration

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-02 17:00:11 +01:00
Daniel P. Berrange
4e42ff6b7e docs: switch to using 'id' attribute instead of 'name' for links
The 'name' attribute on <a...> elements is deprecated in favour
of the 'id' attribute which is allowed on any element. HTML5
drops 'name' support entirely.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-02 17:00:11 +01:00
Martin Kletzander
a54c962286 docs: Add build timestamps to generated html/php pages
In order not to make the build even less reproducible, honour
SOURCE_DATE_EPOCH environment variable as specified:

  https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2017-07-26 17:47:25 +02:00
Martin Kletzander
6e0a1663bd docs: Use href_base in absolute links
That way all links work even if you click them in a subdirectory.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2017-01-04 15:10:06 +01:00
Daniel P. Berrange
7a568d5fca docs: remove navigation sidebar from pages
A combination of the index page, top nav bar and docs.html page
provide links to all pages on the site. The left hand nav bar
is thus redundant and can be removed to provide a simpler style
for the site.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-11 12:15:06 +00:00
Daniel P. Berrange
b17a97f223 docs: rewrite content on front page to be more useful
The front page contains a bunch of content that is either
outdated (eg links to libvirt qpid) or not particularly
useful (links to vendor hypervisor sites).

This rewrites it to be more directly useful to visitors,
providing a updated intro to libvirt project, direct
links to key pieces of website content (new contributors
guide, security process, bug reporting, XML formats), and
feed showing recent 5 blog posts on the virt tools planet.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-11 12:15:05 +00:00
Daniel P. Berrange
47d6bf6c61 docs: add three core links in the header bar
Add links to download, communicate and learn in the
header bar, as the main jumping off points for
navigation.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-11 12:15:05 +00:00
Daniel P. Berrange
90fc9d3f14 docs: add footer to all pages
Add a footer to all pages containing a blurb about the
code of conduct, and links to various communication
channels / social media / user self-help sites.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-11 12:15:05 +00:00
Daniel P. Berrange
e3e0f36719 docs: redo style of front page
Use a large logo banner across the front page. Tile the
three lists of links into three panels

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-11 12:15:03 +00:00
Daniel P. Berrange
2d35438bc6 docs: switch to new website banner
Use a dark banner whose color matches the dark green used in
the logo. Introduce a newly rendered version of the header
logo derived from new SVG file, instead of old one from
(now lost) Adobe Illustrator file.

The top banner logo now links to the front page as is common
practice for most websites.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-11 09:31:10 +00:00
Cole Robinson
e14c5069c5 docs: website: Remove the et.redhat.com footer
This is long since obsolete, just scrap it all
2016-03-10 11:06:25 -05:00
Martin Kletzander
af1b89d1d4 docs: Correct invalid hyperlinks
Since libvirt.h was split into multiple files and similarly
docs/libvirt-libvirt.html, docs/hvsupport.html have bad hyperlinks.  The
same happens for all the html.in files that used <code class='docref'>
tag, because page.xsl has no idea where to point the link that's found.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-12-02 07:30:10 +01:00
Pavel Hrdina
fb321a009f docs/page.xls: remove unnecessary namespace attribute
It breaks the build on RHEL-5.10 and because it's only optional we
could remove it from the code. The default namespace will be used.
This hunk was introduced by commit 237a088ba4.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2014-01-30 15:37:38 +01:00
Dan Kenigsberg
237a088ba4 docs: add a permalink to html headers
Quite often, I need to cite URLs like
    http://libvirt.org/formatnetwork.html#elementQoS
but it is annoying to copy them from the table of contents or the html
source.

This patch borrows from the Python documentation in order to make it
easier to cite headers on libvirt's oneline documentation.
2014-01-27 08:42:09 +01:00
Daniel P. Berrange
da13f2c70c Add documentation for access control system
This adds two new pages to the website, acl.html describing
the general access control framework and permissions models,
and aclpolkit.html describing the use of polkit as an
access control driver.

page.xsl is modified to support a new syntax

  <div id="include" filename="somefile.htmlinc"/>

which will cause the XSL transform to replace that <div>
with the contents of 'somefile.htmlinc'. We use this in
the acl.html.in file, to pull the table of permissions
for each libvirt object. This table is autogenerated
from the enums in src/access/viraccessperms.h by the
genaclperms.pl script.

newapi.xsl is modified so that the list of permissions
checks shown against each API will link to the description
of the permissions in acl.html

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-09 17:13:02 +01:00
Daniel P. Berrange
b1434b36b1 Fix a few more docs XSL bugs related to the TOC
Add missing 'html:' namespace prefix to a few more XSL
rules for generating the table of contents links

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-03 20:57:24 +01:00
Daniel P. Berrange
7ee85c9900 Fix docs generator regression in previous commit
The previous commit failed to update the XSL to take account
of fact that in XHTML mode the elements need namespace
prefixes. This caused every web page to be blank!
2013-05-03 16:58:46 +01:00