Skip to content
Permalink
Browse files

doc: Define {basedir} dynamically

It's necessary to set up the HTML links correctly
in order to avoid hard-coded paths.
  • Loading branch information
jpereira authored and alandekok committed Jul 30, 2019
1 parent f434d9d commit da57df4bc18dbbadbcabd07031531c739d7bb533
@@ -55,7 +55,7 @@ HTML_FILES := $(filter %html,$(patsubst doc/%.adoc,doc/%.html,$(ADOC_FILES)) \
#
# There are a number of pre-built files in the doc/ directory. Find those.
#
DOC_FILES := $(filter-out %~ %/all.mk %.gitignore doc/rfc/update.sh doc/source/% doc/img/%,$(shell find doc -type f))
DOC_FILES := $(filter-out %~ %/all.mk %.gitignore doc/rfc/update.sh doc/source/% doc/templates/%,$(shell find doc -type f))

#
# We sort the list of files, because the "find" command above will
@@ -111,12 +111,16 @@ doc/raddb/%.adoc: raddb/%
#
# Converting *.adoc to *.html
#
# Note that we need to make the BASEDIR relative, so that it works for both
# file:// links and http:// links.
#
doc/%.html: doc/%.adoc
@echo HTML $^
${Q}$(ASCIIDOCTOR) $< -a "toc=left" \
-a "docinfodir=$(PWD)/doc/img" \
-a "imagesdir=$(PWD)/doc/img" \
-a "docinfo=shared,private" \
$(eval BASEDIR := $(patsubst %/,../,$(subst ${top_srcdir}/doc/,,$(dir $@))))
${Q}$(ASCIIDOCTOR) $< -a "toc=left" \
-a "docinfodir=$(BASEDIR)/templates" \
-a "basedir=$(BASEDIR)" \
-a "docinfo=shared,private" \
-b html5 -o $@ $<
${Q}perl -p -i -e 's,\.adoc,\.html,g; s,/.html",/",g; s/\.md\.html/\.html/g' $@

File renamed without changes.
@@ -12,7 +12,7 @@
<p class="tableblock">
<span class="image">
<a class="image" href="http://networkradius.com" target="_blank" rel="noopener">
<img src="/doc/img/networkradius.png" alt="networkradius">
<img src="{basedir}templates/networkradius.png" alt="networkradius">
</a>
</span>
</p>
@@ -23,3 +23,4 @@
</tr>
</tbody>
</table>

@@ -7,7 +7,7 @@
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/javascripts/jquery.tocify.min.js"></script>
<!-- We do not need the tocify CSS because the asciidoc CSS already provides most of what we neeed -->
<!-- We do not need the tocify CSS because the asciidoc CSS already provides most of what we need -->

<style>
.tocify-header {
@@ -80,6 +80,6 @@
</script>

<div align="right">
<a href="/doc/"><img src="/doc/img/home.png" border="0" width="30" height="30"></a>
<a href="{basedir}index.html"><img src="{basedir}templates/home.png" border="0" width="30" height="30"></a>
&nbsp;
</div>
File renamed without changes.
File renamed without changes.

0 comments on commit da57df4

Please sign in to comment.
You can’t perform that action at this time.