Skip to content

Commit 900b60e

Browse files
update styles, code-copying, and heading regex
1 parent 69e37cb commit 900b60e

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

jekyll-assets/css/style.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,35 @@ div.videoblock iframe {
725725
background-color: #50C878;
726726
}
727727

728+
div.listingblock pre.highlight {
729+
margin-top: 0px;
730+
margin-bottom: 0px;
731+
}
732+
733+
#content div.listingblock table.linenotable {
734+
margin-bottom: 0px;
735+
}
736+
737+
#content td.hdlist1 {
738+
line-height: 1.5em;
739+
}
740+
741+
#content td.hdlist2 > p {
742+
margin-bottom: 0px;
743+
}
744+
745+
#content td.linenos {
746+
padding-right: 10px;
747+
}
748+
749+
.highlight td.code pre {
750+
background-color: transparent;
751+
margin-top: 0px;
752+
margin-bottom: 0px;
753+
}
754+
755+
/* OLD DOXYGEN ELEMENTS */
756+
728757
div.memproto {
729758
background-color: #dedede;
730759
padding: 7px;

jekyll-assets/scripts/copy-to-clipboard.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var hideTooltip = function() {
2828
};
2929

3030
var extractDoxygenCode = function(node) {
31-
var lines = node.querySelectorAll("div.line");
31+
var lines = node.querySelectorAll("div.code");
3232
var preText = "";
3333
for (var i = 0; i < lines.length; i++) {
3434
var myText = lines[i].textContent;
@@ -45,8 +45,9 @@ for (var i = 0; i < buttons.length; i++) {
4545
window.addEventListener('load', function() {
4646
var clipboard = new ClipboardJS('.copy-button', {
4747
text: function(trigger) {
48-
if (trigger.parentNode.querySelector('div.line')) {
49-
var text = extractDoxygenCode(trigger.parentNode);
48+
if (trigger.parentNode.querySelector('td.code')) {
49+
// var text = extractDoxygenCode(trigger.parentNode);
50+
var text = trigger.parentNode.querySelector('td.code pre').textContent;
5051
} else {
5152
var text = trigger.parentNode.querySelector('pre').textContent;
5253

scripts/postprocess_doxygen_adoc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
import os
44
import json
55

6+
# TO DO: fix links:
7+
# collect all link anchors in the file
8+
# then open each file, find all link, point to the correct anchor
9+
610
def cleanup_text_page(adoc_file, output_adoc_path):
711
script_path = os.path.realpath(__file__)
812
top_dir_path = re.sub(r'/scripts/.*$', "", script_path)
@@ -60,7 +64,7 @@ def postprocess_doxygen_adoc(adoc_file, output_adoc_path):
6064

6165
# now split the file into top-level sections:
6266
# toolchain expects all headings to be two levels lower
63-
adoc_content = re.sub(r'\n==', "\n", adoc_content)
67+
adoc_content = re.sub(r'(\n==)(=+ \S+)', "\n\\2", adoc_content)
6468
# then make it easier to match the chapter breaks
6569
adoc_content = re.sub(r'(\[#.*?,reftext=".*?"\])(\s*\n)(= )', "\\1\\3", adoc_content)
6670
# find all the chapter descriptions, to use later

0 commit comments

Comments
 (0)