File tree Expand file tree Collapse file tree 4 files changed +60
-2
lines changed Expand file tree Collapse file tree 4 files changed +60
-2
lines changed Original file line number Diff line number Diff line change
1
+ .admonition .key-idea {
2
+ background : # FFF0B3 ;
3
+ }
4
+ .admonition .concept {
5
+ background : # E6E6FA ;
6
+ }
Original file line number Diff line number Diff line change 22
22
23
23
project = 'Haskell Optimization Handbook'
24
24
html_title = 'Haskell Optimization Handbook'
25
- # FIXME: https://github.com/input-output-hk /hs-opt-handbook.github.io/issues/58
25
+ # FIXME: https://github.com/haskellFoundation /hs-opt-handbook.github.io/issues/58
26
26
copyright = u'2022-%s, Jeffrey Young (doyougnu)' % time .strftime ('%Y' )
27
27
author = 'Jeffrey Young (doyugnu)'
28
28
47
47
, 'sphinx_copybutton'
48
48
# , 'sphinxcontrib.execHS.ext'
49
49
, 'sphinx_exec_directive'
50
+ , 'conceptual_admonitions'
50
51
]
51
52
52
53
# flags
95
96
html_theme = "press"
96
97
html_theme_options = { "body_max_width" : 1600 }
97
98
html_static_path = ['_static' , 'code' ]
98
- html_css_files = [ 'css/s4defs-roles.css' , 'css/iframe.css' ]
99
+ html_css_files = [ 'css/s4defs-roles.css' , 'css/iframe.css' , 'css/admonitions.css' ]
99
100
100
101
# Add any paths that contain custom static files (such as style sheets) here,
101
102
# relative to this directory. They are copied after the builtin static files,
106
107
# bibtex file
107
108
bibtex_bibfiles = ['bib/book.bib' ]
108
109
bibtex_default_style = 'unsrt'
110
+
111
+ def setup (app ):
112
+ for sheet in html_css_files :
113
+ app .add_css_file (sheet )
Original file line number Diff line number Diff line change
1
+ from docutils import nodes
2
+ from docutils .parsers .rst import Directive
3
+
4
+ from sphinx .locale import _
5
+ from sphinx .util .docutils import SphinxDirective
6
+
7
+ class keyIdeaDirective (SphinxDirective ):
8
+
9
+ has_content = True
10
+
11
+ def run (self ):
12
+ key_idea_node = keyIdea (self .content )
13
+ key_idea_node += nodes .Title (_ ('Key Idea' ), _ ('Key Idea' ))
14
+ self .state .nested_parse (self .content , self .content_offset , key_idea_node )
15
+ return [key_idea_node ]
16
+
17
+ class keyIdea (nodes .Admonition , nodes .Element ):
18
+ pass
19
+
20
+ def visit_keyidea_node (self ,node ):
21
+ self .visit_admonition (node )
22
+
23
+ def depart_keyidea_node (self , node ):
24
+ self .depart_admonition (node )
25
+
26
+ def setup (app ):
27
+ app .add_node (keyIdea ,
28
+ html = (visit_keyidea_node , depart_keyidea_node ),
29
+ latex = (visit_keyidea_node , depart_keyidea_node ),
30
+ text = (visit_keyidea_node , depart_keyidea_node ))
31
+ app .add_directive ("keyIdea" , keyIdeaDirective )
32
+
33
+ return {
34
+ 'version' : '0.1' ,
35
+ 'parallel_read_safe' : True ,
36
+ 'parallel_write_safe' : True ,
37
+ }
Original file line number Diff line number Diff line change 2
2
3
3
SBV and the Bizarre GHC Regression
4
4
==================================
5
+
6
+ .. admonition :: Concept
7
+ :class: concept
8
+
9
+ I'm a concept
10
+
11
+ .. admonition :: Key Idea
12
+ :class: key-idea
13
+
14
+ I'm a key idea
You can’t perform that action at this time.
0 commit comments