From dbee5c92a10ecc6acf5a58d26ad23b0d0f1e0298 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Tue, 8 Jan 2013 14:26:26 +0100 Subject: [PATCH] Highlight external links in HTML documentation Based on MediaWiki's monobook skin. Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- Makefile.am | 3 +++ doc/conf.py | 4 +++- doc/css/style.css | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 doc/css/style.css diff --git a/Makefile.am b/Makefile.am index 1a7ab8fae..81cfbb50d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -82,6 +82,7 @@ DIRS = \ devel \ doc \ doc/examples \ + doc/examples/css \ doc/examples/gnt-debug \ doc/examples/hooks \ test/data/htools \ @@ -584,6 +585,7 @@ $(RUN_IN_TEMPDIR): | stamp-directories doc/html/index.html: $(docrst) doc/conf.py configure.ac \ $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \ lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \ + doc/css/style.css \ | $(BUILT_PYTHON_SOURCES) @test -n "$(SPHINX)" || \ { echo 'sphinx-build' not found during configure; exit 1; } @@ -812,6 +814,7 @@ EXTRA_DIST = \ tools/vcluster-setup.in \ $(docrst) \ doc/conf.py \ + doc/css/style.css \ doc/html \ $(BUILT_EXAMPLES:%=%.in) \ doc/examples/ganeti.default \ diff --git a/doc/conf.py b/doc/conf.py index 57b0aae8a..cd26c3ad4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -134,7 +134,9 @@ html_theme = "default" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = [] +html_static_path = ["css"] + +html_style = "style.css" # If not "", a "Last updated on:" timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/doc/css/style.css b/doc/css/style.css new file mode 100644 index 000000000..3107550e1 --- /dev/null +++ b/doc/css/style.css @@ -0,0 +1,7 @@ +@import url(default.css); + +a.external { + /* Based on MediaWiki's monobook skin (licenced as GPL) */ + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs%2B9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB%2FIkeGOrxXhqB%2BuA9Bfcm0lAZuh%2BYIeAD%2BcAqSz4kCMUAAAAASUVORK5CYII%3D") no-repeat scroll right center transparent; + padding-right: 13px; +} -- GitLab