Skip to content

Commit f7527bc

Browse files
committed
Bugfix: respect WIP double-colon target
1 parent 276bffc commit f7527bc

5 files changed

Lines changed: 25 additions & 4 deletions

File tree

makefile-doc.awk

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function parse_variable_name(whole_line_string, #locals
228228
return variable_name
229229
}
230230

231-
# this is the key function (FIXME: make the debugging code less intrusive)
231+
# it would be nice to make the debugging code less intrusive
232232
function associate_data_with_anchor(anchor_name,
233233
anchors,
234234
anchors_index,
@@ -588,11 +588,17 @@ function display_anchor_with_data(anchor, description, section, len_anchors, #lo
588588
}
589589

590590
function count_numb_double_colon(new_target, #locals
591-
counter, target, target_split, key) {
591+
counter, target, wip_target_split, target_split, key) {
592+
split(WIP_TARGET, wip_target_split, DOUBLE_COLON_SEPARATOR)
593+
if (wip_target_split[1] == new_target) {
594+
# if we are still dealing with the WIP target, return its index
595+
return wip_target_split[2]
596+
}
597+
592598
counter = 1
593599
for (key in TARGETS) { # order is not important
594600
target = TARGETS[key]
595-
split(target, target_split, "~")
601+
split(target, target_split, DOUBLE_COLON_SEPARATOR)
596602
if (target_split[1] == new_target) {
597603
counter++
598604
}
@@ -837,7 +843,7 @@ function initialize_colors() {
837843
ansi_color_param_to_html_style("BG", "BG"))
838844
} else if (OUTPUT_FORMAT == "LATEX") {
839845
LATEX_FOOTER = "\\end{alltt}\n\\end{varwidth}\n\\end{document}"
840-
# FIXME: I don't see a better way to store this
846+
# Is there a better way to store this?
841847
LATEX_HEADER = sprintf("\\documentclass{article}\n\\usepackage[utf8]{inputenc}\n\\usepackage{xcolor}\n\\usepackage{alltt}\n\\usepackage[top=0cm, bottom=0cm, left=0cm, right=0cm]{geometry}\n\\usepackage{varwidth}\n\\usepackage[active,tightpage]{preview}\n\\usepackage[normalem]{ulem}\n\n\\setlength{\\fboxsep}{0pt}\n\n\\newcommand{\\bgcolor}[2]{\\colorbox{#1}{\\vphantom{Ay}#2}}\n\n\\PreviewEnvironment{varwidth}\n\n%s%s\\definecolor{color-attention}{HTML}{%s}\n\\definecolor{color-section}{HTML}{%s}\n\\definecolor{color-deprecated}{HTML}{%s}\n\\definecolor{color-default}{HTML}{%s}\n\\definecolor{color-warning}{HTML}{%s}\n\\definecolor{color-backticks}{HTML}{%s}\n\n\\pagestyle{empty}\n\\begin{document}\n\n\\begin{varwidth}{\\linewidth}\n%s%s\n\\begin{alltt}",
842848
ansi_color_param_to_latex_color("FG", 1),
843849
ansi_color_param_to_latex_color("BG", 1),

test/Makefile.targets-2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ double-colon-B:: ## group B second documented
2828
double-colon-A:: ## This is the second double-colon target from group A
2929

3030
double-colon-B:: ##% group B third documented (deprecated)
31+
32+
## This is a top doc for dc1~1
33+
dc1:: ## this is inline (not shown) still dc1~1
34+
dc1:: ## ... still dc1~1
35+
dc1:: ## ... still dc1~1
36+
37+
dc1:: ## this is dc1~2
38+
dc1:: ## ... dc1~2
39+
dc1:: ## ... dc1~2

test/recipes/test-double-colon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ Available targets:
1616
double-colon-B~2 group B second documented
1717
double-colon-A~2 This is the second double-colon target from group A
1818
double-colon-B~3 group B third documented (deprecated)
19+
dc1~1  This is a top doc for dc1~1
20+
dc1~2  this is dc1~2
1921
-----------------------

test/recipes/test-html-bold

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ double-colon-B~1 group B first documented
3535
<span class="color-default">double-colon-B~2 </span> group B second documented
3636
<span class="color-default">double-colon-A~2 </span> This is the second double-colon target from group A
3737
<span class="color-deprecated">double-colon-B~3 </span> group B third documented (deprecated)
38+
<span class="color-default">dc1~1 </span> This is a top doc for dc1~1
39+
<span class="color-default">dc1~2 </span> this is dc1~2
3840
<span class="color-section">
3941
----- Independent Targets -----
4042
</span>

test/recipes/test-latex-bold

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ double-colon-B~1 group B first documented
5252
\textcolor{color-default}{double-colon-B~2 } group B second documented
5353
\textcolor{color-default}{double-colon-A~2 } This is the second double-colon target from group A
5454
\sout{double-colon-B~3 } group B third documented (deprecated)
55+
\textcolor{color-default}{dc1~1 } This is a top doc for dc1~1
56+
\textcolor{color-default}{dc1~2 } this is dc1~2
5557
\emph{
5658
----- Independent Targets -----
5759
}

0 commit comments

Comments
 (0)