Copy the CSS into the built docs
This patch adds code that copies the CSS file into the _static directory on build. Previously the CSS file was not included in the built docs. Change-Id: Ic7cc52b007b0c40b3aa85a242544c3c6aac16c02
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Adds a handler to copy the CSS file into the _static directory on build.
|
||||
Previously the CSS file was not being copied over into the built docs.
|
@@ -19,7 +19,9 @@ It is used via a single directive in the .rst file
|
||||
|
||||
"""
|
||||
|
||||
from os import path
|
||||
import re
|
||||
import shutil
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers import rst
|
||||
@@ -463,6 +465,15 @@ class Directive(rst.Directive):
|
||||
return para
|
||||
|
||||
|
||||
def on_build_finished(app, exc):
|
||||
if exc is None:
|
||||
src = path.join(path.abspath(path.dirname(__file__)),
|
||||
'support-matrix.css')
|
||||
dst = path.join(app.outdir, '_static', 'support-matrix.css')
|
||||
shutil.copyfile(src, dst)
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.add_directive('support_matrix', Directive)
|
||||
app.add_css_file('support-matrix.css')
|
||||
app.connect('build-finished', on_build_finished)
|
||||
|
Reference in New Issue
Block a user