Skip to content

Commit

Permalink
update doc config
Browse files Browse the repository at this point in the history
  • Loading branch information
gseidel committed Jan 21, 2020
1 parent c4e4c1a commit 682fe80
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ indent_size = 4
[*.json]
indent_style = space
indent_size = 2

[*.{rst,rst.inc}]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
Empty file.
Empty file.
Empty file.
88 changes: 88 additions & 0 deletions docs/extension/enhavo/sphinx/styles/enhavo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
from pygments.style import Style
from pygments.formatters import HtmlFormatter
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal


class EnhavoStyle(Style):
background_color = "#000000"
default_style = ""

styles = {
# No corresponding class for the following:
#Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#ffffff", # class 'x'

Comment: "italic #B729D9", # class: 'c'
Comment.Single: "italic #B729D9", # class: 'c1'
Comment.Multiline: "italic #B729D9", # class: 'cm'
Comment.Preproc: "noitalic #aaa", # class: 'cp'

Keyword: "#FF8400", # class: 'k'
Keyword.Constant: "#FF8400", # class: 'kc'
Keyword.Declaration: "#FF8400", # class: 'kd'
Keyword.Namespace: "#FF8400", # class: 'kn'
Keyword.Pseudo: "#FF8400", # class: 'kp'
Keyword.Reserved: "#FF8400", # class: 'kr'
Keyword.Type: "#FF8400", # class: 'kt'

Operator: "#E0882F", # class: 'o'
Operator.Word: "#E0882F", # class: 'ow' - like keywords

Punctuation: "#999999", # class: 'p'

# because special names such as Name.Class, Name.Function, etc.
# are not recognized as such later in the parsing, we choose them
# to look the same as ordinary variables.
Name: "#ffffff", # class: 'n'
Name.Attribute: "#ffffff", # class: 'na' - to be revised
Name.Builtin: "#ffffff", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#ffffff", # class: 'nc' - to be revised
Name.Constant: "#ffffff", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "#cc0000", # class: 'ne'
Name.Function: "#ffffff", # class: 'nf'
Name.Property: "#ffffff", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#ffffff", # class: 'nn' - to be revised
Name.Other: "#ffffff", # class: 'nx'
Name.Tag: "#cccccc", # class: 'nt' - like a keyword
Name.Variable: "#ffffff", # class: 'nv' - to be revised
Name.Variable.Class: "#ffffff", # class: 'vc' - to be revised
Name.Variable.Global: "#ffffff", # class: 'vg' - to be revised
Name.Variable.Instance: "#ffffff", # class: 'vi' - to be revised

Number: "#1299DA", # class: 'm'

Literal: "#ffffff", # class: 'l'
Literal.Date: "#ffffff", # class: 'ld'

String: "#56DB3A", # class: 's'
String.Backtick: "#56DB3A", # class: 'sb'
String.Char: "#56DB3A", # class: 'sc'
String.Doc: "italic #B729D9", # class: 'sd' - like a comment
String.Double: "#56DB3A", # class: 's2'
String.Escape: "#56DB3A", # class: 'se'
String.Heredoc: "#56DB3A", # class: 'sh'
String.Interpol: "#56DB3A", # class: 'si'
String.Other: "#56DB3A", # class: 'sx'
String.Regex: "#56DB3A", # class: 'sr'
String.Single: "#56DB3A", # class: 's1'
String.Symbol: "#56DB3A", # class: 'ss'

Generic: "#ffffff", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #ffffff", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "#000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #ffffff", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
}
16 changes: 10 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
import sys
import os
import shlex

# Add extension to module lookup path
sys.path.append(os.path.abspath('../extension'))

from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer

lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autodoc', 'enhavo.sphinx'
]
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
project = u'enhavo'
copyright = u'2018, xq web'
copyright = u'2020, xq web'
author = u'xq web'
version = '0.6'
release = '0.6'
version = '0.9'
release = '0.9'
language = None
exclude_patterns = []
pygments_style = 'sphinx'
todo_include_todos = False
pygments_style = 'sphinx'
html_theme = 'enhavo'
html_theme_path = ['../theme']
latex_elements = {}
Expand All @@ -40,4 +44,4 @@
(master_doc, 'enhavo', u'enhavo Documentation',
author, 'enhavo', 'One line description of project.',
'Miscellaneous'),
]
]

0 comments on commit 682fe80

Please sign in to comment.