# HG changeset patch # User David Demelier # Date 1473873609 -7200 # Node ID 803e7e990b4bc3657d90b31c2bd5c00753a1fc57 # Parent 904ee87bc808ff89d98844f78e2aef25639c676e CMake: add brand new breadcrumb as navigation, closes #536 diff -r 904ee87bc808 -r 803e7e990b4b doc/html/CMakeLists.txt --- a/doc/html/CMakeLists.txt Wed Sep 14 13:36:06 2016 +0200 +++ b/doc/html/CMakeLists.txt Wed Sep 14 19:20:09 2016 +0200 @@ -173,10 +173,12 @@ if (WITH_HTML) foreach (file ${HTML_SOURCES}) # 'baseurl': compute the tree from the file to this directory. + # 'inputbase': the canonical file name. get_filename_component(fulldirectory ${file} DIRECTORY) + get_filename_component(inputname ${file} NAME_WE) file(RELATIVE_PATH baseurl ${fulldirectory} ${html_SOURCE_DIR}) - # 'inputname': relative to this source directory. + # 'inputbase': relative to this source directory. file(RELATIVE_PATH inputbase ${html_SOURCE_DIR} ${file}) # 'outputbase': replace .md to .html as file extension. @@ -193,10 +195,32 @@ ${html_BINARY_DIR}/${inputbase} ) + # Create a list of parents for the breadcrumb widget. + get_filename_component(parentlist ${inputbase} DIRECTORY) + string(REPLACE "/" ";" parentlist "${parentlist}") + set(parents " -\n") + set(parents "${parents} name: \"index\"\n") + set(parents "${parents} path: \"${baseurl}index.html\"\n") + + set(path "${baseurl}") + foreach (p ${parentlist}) + set(path "${path}${p}/") + set(parents "${parents} -\n") + set(parents "${parents} name: \"${p}\"\n") + set(parents "${parents} path: \"${path}index.html\"\n") + endforeach () + + configure_file( + ${html_SOURCE_DIR}/resources/metadata.yml + ${html_BINARY_DIR}/${inputbase}.yml + ) + # Create an output target to that file. pandoc( OUTPUT ${IRCCD_FAKEROOTDIR}/${WITH_DOCDIR}/${outputbase} - SOURCES ${html_BINARY_DIR}/${inputbase} + SOURCES + ${html_BINARY_DIR}/${inputbase}.yml + ${html_BINARY_DIR}/${inputbase} DEPENDS ${file} TEMPLATE ${html_SOURCE_DIR}/resources/template.html VARIABLE baseurl:${baseurl} diff -r 904ee87bc808 -r 803e7e990b4b doc/html/resources/metadata.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/html/resources/metadata.yml Wed Sep 14 19:20:09 2016 +0200 @@ -0,0 +1,5 @@ +--- +parents: +@parents@ +filename: "@inputname@" +--- diff -r 904ee87bc808 -r 803e7e990b4b doc/html/resources/template.html --- a/doc/html/resources/template.html Wed Sep 14 13:36:06 2016 +0200 +++ b/doc/html/resources/template.html Wed Sep 14 19:20:09 2016 +0200 @@ -85,6 +85,13 @@
+ + $if(js)$