Browse Source

build based on de25a23

gh-pages
Documenter.jl 2 years ago
parent
commit
bd23e50cc7
  1. 2
      dev/.documenter-siteinfo.json
  2. 505
      dev/assets/documenter.js
  3. 2
      dev/assets/themes/documenter-dark.css
  4. 2
      dev/customprocessing/index.html
  5. 2
      dev/documenter/index.html
  6. 2
      dev/fileformat/index.html
  7. 130
      dev/generated/example.ipynb
  8. 64
      dev/generated/example/1e7d4c4b.svg
  9. 4
      dev/generated/example/index.html
  10. 2
      dev/generated/name/index.html
  11. 2
      dev/index.html
  12. BIN
      dev/objects.inv
  13. 4
      dev/outputformats/index.html
  14. 2
      dev/pipeline/index.html
  15. 2
      dev/reference/index.html
  16. 2
      dev/tips/index.html

2
dev/.documenter-siteinfo.json

@ -1 +1 @@
{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-04-14T12:02:19","documenter_version":"1.2.1"}} {"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-04-14T12:02:39","documenter_version":"1.3.0"}}

505
dev/assets/documenter.js

@ -4,7 +4,6 @@ requirejs.config({
'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/julia.min', 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/julia.min',
'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min', 'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min',
'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min', 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min',
'minisearch': 'https://cdn.jsdelivr.net/npm/minisearch@6.1.0/dist/umd/index.min',
'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/contrib/auto-render.min', 'katex-auto-render': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/contrib/auto-render.min',
'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min', 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min',
'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min', 'headroom-jquery': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/jQuery.headroom.min',
@ -103,9 +102,10 @@ $(document).on("click", ".docstring header", function () {
}); });
}); });
$(document).on("click", ".docs-article-toggle-button", function () { $(document).on("click", ".docs-article-toggle-button", function (event) {
let articleToggleTitle = "Expand docstring"; let articleToggleTitle = "Expand docstring";
let navArticleToggleTitle = "Expand all docstrings"; let navArticleToggleTitle = "Expand all docstrings";
let animationSpeed = event.noToggleAnimation ? 0 : 400;
debounce(() => { debounce(() => {
if (isExpanded) { if (isExpanded) {
@ -116,7 +116,7 @@ $(document).on("click", ".docs-article-toggle-button", function () {
isExpanded = false; isExpanded = false;
$(".docstring section").slideUp(); $(".docstring section").slideUp(animationSpeed);
} else { } else {
$(this).removeClass("fa-chevron-down").addClass("fa-chevron-up"); $(this).removeClass("fa-chevron-down").addClass("fa-chevron-up");
$(".docstring-article-toggle-button") $(".docstring-article-toggle-button")
@ -127,7 +127,7 @@ $(document).on("click", ".docs-article-toggle-button", function () {
articleToggleTitle = "Collapse docstring"; articleToggleTitle = "Collapse docstring";
navArticleToggleTitle = "Collapse all docstrings"; navArticleToggleTitle = "Collapse all docstrings";
$(".docstring section").slideDown(); $(".docstring section").slideDown(animationSpeed);
} }
$(this).prop("title", navArticleToggleTitle); $(this).prop("title", navArticleToggleTitle);
@ -224,15 +224,93 @@ $(document).ready(function () {
}) })
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
require(['jquery', 'minisearch'], function($, minisearch) { require(['jquery'], function($) {
$(document).ready(function () {
let meta = $("div[data-docstringscollapsed]").data();
if (meta?.docstringscollapsed) {
$("#documenter-article-toggle-button").trigger({
type: "click",
noToggleAnimation: true,
});
}
});
})
////////////////////////////////////////////////////////////////////////////////
require(['jquery'], function($) {
/*
To get an in-depth about the thought process you can refer: https://hetarth02.hashnode.dev/series/gsoc
PSEUDOCODE:
Searching happens automatically as the user types or adjusts the selected filters.
To preserve responsiveness, as much as possible of the slow parts of the search are done
in a web worker. Searching and result generation are done in the worker, and filtering and
DOM updates are done in the main thread. The filters are in the main thread as they should
be very quick to apply. This lets filters be changed without re-searching with minisearch
(which is possible even if filtering is on the worker thread) and also lets filters be
changed _while_ the worker is searching and without message passing (neither of which are
possible if filtering is on the worker thread)
SEARCH WORKER:
Import minisearch
// In general, most search related things will have "search" as a prefix. Build index
// To get an in-depth about the thought process you can refer: https://hetarth02.hashnode.dev/series/gsoc
let results = []; On message from main thread
let timer = undefined; run search
find the first 200 unique results from each category, and compute their divs for display
note that this is necessary and sufficient information for the main thread to find the
first 200 unique results from any given filter set
post results to main thread
let data = documenterSearchIndex["docs"].map((x, key) => { MAIN:
Launch worker
Declare nonconstant globals (worker_is_running, last_search_text, unfiltered_results)
On text update
if worker is not running, launch_search()
launch_search
set worker_is_running to true, set last_search_text to the search text
post the search query to worker
on message from worker
if last_search_text is not the same as the text in the search field,
the latest search result is not reflective of the latest search query, so update again
launch_search()
otherwise
set worker_is_running to false
regardless, display the new search results to the user
save the unfiltered_results as a global
update_search()
on filter click
adjust the filter selection
update_search()
update_search
apply search filters by looping through the unfiltered_results and finding the first 200
unique results that match the filters
Update the DOM
*/
/////// SEARCH WORKER ///////
function worker_function(documenterSearchIndex, documenterBaseURL, filters) {
importScripts(
"https://cdn.jsdelivr.net/npm/minisearch@6.1.0/dist/umd/index.min.js"
);
let data = documenterSearchIndex.map((x, key) => {
x["id"] = key; // minisearch requires a unique for each object x["id"] = key; // minisearch requires a unique for each object
return x; return x;
}); });
@ -348,9 +426,9 @@ const stopWords = new Set([
"your", "your",
]); ]);
let index = new minisearch({ let index = new MiniSearch({
fields: ["title", "text"], // fields to index for full-text search fields: ["title", "text"], // fields to index for full-text search
storeFields: ["location", "title", "text", "category", "page"], // fields to return with search results storeFields: ["location", "title", "text", "category", "page"], // fields to return with results
processTerm: (term) => { processTerm: (term) => {
let word = stopWords.has(term) ? null : term; let word = stopWords.has(term) ? null : term;
if (word) { if (word) {
@ -358,180 +436,58 @@ let index = new minisearch({
word = word word = word
.replace(/^[^a-zA-Z0-9@!]+/, "") .replace(/^[^a-zA-Z0-9@!]+/, "")
.replace(/[^a-zA-Z0-9@!]+$/, ""); .replace(/[^a-zA-Z0-9@!]+$/, "");
word = word.toLowerCase();
} }
return word ?? null; return word ?? null;
}, },
// add . as a separator, because otherwise "title": "Documenter.Anchors.add!", would not find anything if searching for "add!", only for the entire qualification // add . as a separator, because otherwise "title": "Documenter.Anchors.add!", would not
// find anything if searching for "add!", only for the entire qualification
tokenize: (string) => string.split(/[\s\-\.]+/), tokenize: (string) => string.split(/[\s\-\.]+/),
// options which will be applied during the search // options which will be applied during the search
searchOptions: { searchOptions: {
prefix: true,
boost: { title: 100 }, boost: { title: 100 },
fuzzy: 2, fuzzy: 2,
processTerm: (term) => {
let word = stopWords.has(term) ? null : term;
if (word) {
word = word
.replace(/^[^a-zA-Z0-9@!]+/, "")
.replace(/[^a-zA-Z0-9@!]+$/, "");
}
return word ?? null;
},
tokenize: (string) => string.split(/[\s\-\.]+/),
}, },
}); });
index.addAll(data); index.addAll(data);
let filters = [...new Set(data.map((x) => x.category))];
var modal_filters = make_modal_body_filters(filters);
var filter_results = [];
$(document).on("keyup", ".documenter-search-input", function (event) {
// Adding a debounce to prevent disruptions from super-speed typing!
debounce(() => update_search(filter_results), 300);
});
$(document).on("click", ".search-filter", function () {
if ($(this).hasClass("search-filter-selected")) {
$(this).removeClass("search-filter-selected");
} else {
$(this).addClass("search-filter-selected");
}
// Adding a debounce to prevent disruptions from crazy clicking!
debounce(() => get_filters(), 300);
});
/** /**
* A debounce function, takes a function and an optional timeout in milliseconds * Used to map characters to HTML entities.
* * Refer: https://github.com/lodash/lodash/blob/main/src/escape.ts
* @function callback
* @param {number} timeout
*/ */
function debounce(callback, timeout = 300) { const htmlEscapes = {
clearTimeout(timer); "&": "&",
timer = setTimeout(callback, timeout); "<": "&lt;",
} ">": "&gt;",
'"': "&quot;",
"'": "&#39;",
};
/** /**
* Make/Update the search component * Used to match HTML entities and HTML characters.
* * Refer: https://github.com/lodash/lodash/blob/main/src/escape.ts
* @param {string[]} selected_filters
*/ */
function update_search(selected_filters = []) { const reUnescapedHtml = /[&<>"']/g;
let initial_search_body = ` const reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
<div class="has-text-centered my-5 py-5">Type something to get started!</div>
`;
let querystring = $(".documenter-search-input").val();
if (querystring.trim()) {
results = index.search(querystring, {
filter: (result) => {
// Filtering results
if (selected_filters.length === 0) {
return result.score >= 1;
} else {
return (
result.score >= 1 && selected_filters.includes(result.category)
);
}
},
});
let search_result_container = ``;
let search_divider = `<div class="search-divider w-100"></div>`;
if (results.length) {
let links = [];
let count = 0;
let search_results = "";
results.forEach(function (result) {
if (result.location) {
// Checking for duplication of results for the same page
if (!links.includes(result.location)) {
search_results += make_search_result(result, querystring);
count++;
}
links.push(result.location);
}
});
let result_count = `<div class="is-size-6">${count} result(s)</div>`;
search_result_container = `
<div class="is-flex is-flex-direction-column gap-2 is-align-items-flex-start">
${modal_filters}
${search_divider}
${result_count}
<div class="is-clipped w-100 is-flex is-flex-direction-column gap-2 is-align-items-flex-start has-text-justified mt-1">
${search_results}
</div>
</div>
`;
} else {
search_result_container = `
<div class="is-flex is-flex-direction-column gap-2 is-align-items-flex-start">
${modal_filters}
${search_divider}
<div class="is-size-6">0 result(s)</div>
</div>
<div class="has-text-centered my-5 py-5">No result found!</div>
`;
}
if ($(".search-modal-card-body").hasClass("is-justify-content-center")) {
$(".search-modal-card-body").removeClass("is-justify-content-center");
}
$(".search-modal-card-body").html(search_result_container);
} else {
filter_results = [];
modal_filters = make_modal_body_filters(filters, filter_results);
if (!$(".search-modal-card-body").hasClass("is-justify-content-center")) {
$(".search-modal-card-body").addClass("is-justify-content-center");
}
$(".search-modal-card-body").html(initial_search_body);
}
}
/** /**
* Make the modal filter html * Escape function from lodash
* * Refer: https://github.com/lodash/lodash/blob/main/src/escape.ts
* @param {string[]} filters
* @param {string[]} selected_filters
* @returns string
*/ */
function make_modal_body_filters(filters, selected_filters = []) { function escape(string) {
let str = ``; return string && reHasUnescapedHtml.test(string)
? string.replace(reUnescapedHtml, (chr) => htmlEscapes[chr])
filters.forEach((val) => { : string || "";
if (selected_filters.includes(val)) {
str += `<a href="javascript:;" class="search-filter search-filter-selected"><span>${val}</span></a>`;
} else {
str += `<a href="javascript:;" class="search-filter"><span>${val}</span></a>`;
}
});
let filter_html = `
<div class="is-flex gap-2 is-flex-wrap-wrap is-justify-content-flex-start is-align-items-center search-filters">
<span class="is-size-6">Filters:</span>
${str}
</div>
`;
return filter_html;
} }
/** /**
* Make the result component given a minisearch result data object and the value of the search input as queryString. * Make the result component given a minisearch result data object and the value
* To view the result object structure, refer: https://lucaong.github.io/minisearch/modules/_minisearch_.html#searchresult * of the search input as queryString. To view the result object structure, refer:
* https://lucaong.github.io/minisearch/modules/_minisearch_.html#searchresult
* *
* @param {object} result * @param {object} result
* @param {string} querystring * @param {string} querystring
@ -547,7 +503,7 @@ function make_search_result(result, querystring) {
display_link += ` (${result.page})`; display_link += ` (${result.page})`;
} }
let textindex = new RegExp(`\\b${querystring}\\b`, "i").exec(result.text); let textindex = new RegExp(`${querystring}`, "i").exec(result.text);
let text = let text =
textindex !== null textindex !== null
? result.text.slice( ? result.text.slice(
@ -559,11 +515,13 @@ function make_search_result(result, querystring) {
) )
: ""; // cut-off text before and after from the match : ""; // cut-off text before and after from the match
text = text.length ? escape(text) : "";
let display_result = text.length let display_result = text.length
? "..." + ? "..." +
text.replace( text.replace(
new RegExp(`\\b${querystring}\\b`, "i"), // For first occurrence new RegExp(`${escape(querystring)}`, "i"), // For first occurrence
'<span class="search-result-highlight p-1">$&</span>' '<span class="search-result-highlight py-1">$&</span>'
) + ) +
"..." "..."
: ""; // highlights the match : ""; // highlights the match
@ -581,7 +539,7 @@ function make_search_result(result, querystring) {
<div class="w-100 is-flex is-flex-wrap-wrap is-justify-content-space-between is-align-items-flex-start"> <div class="w-100 is-flex is-flex-wrap-wrap is-justify-content-space-between is-align-items-flex-start">
<div class="search-result-title has-text-weight-bold ${ <div class="search-result-title has-text-weight-bold ${
in_code ? "search-result-code-title" : "" in_code ? "search-result-code-title" : ""
}">${result.title}</div> }">${escape(result.title)}</div>
<div class="property-search-result-badge">${result.category}</div> <div class="property-search-result-badge">${result.category}</div>
</div> </div>
<p> <p>
@ -601,14 +559,213 @@ function make_search_result(result, querystring) {
return result_div; return result_div;
} }
self.onmessage = function (e) {
let query = e.data;
let results = index.search(query, {
filter: (result) => {
// Only return relevant results
return result.score >= 1;
},
});
// Pre-filter to deduplicate and limit to 200 per category to the extent
// possible without knowing what the filters are.
let filtered_results = [];
let counts = {};
for (let filter of filters) {
counts[filter] = 0;
}
let present = {};
for (let result of results) {
cat = result.category;
cnt = counts[cat];
if (cnt < 200) {
id = cat + "---" + result.location;
if (present[id]) {
continue;
}
present[id] = true;
filtered_results.push({
location: result.location,
category: cat,
div: make_search_result(result, query),
});
}
}
postMessage(filtered_results);
};
}
// `worker = Threads.@spawn worker_function(documenterSearchIndex)`, but in JavaScript!
const filters = [
...new Set(documenterSearchIndex["docs"].map((x) => x.category)),
];
const worker_str =
"(" +
worker_function.toString() +
")(" +
JSON.stringify(documenterSearchIndex["docs"]) +
"," +
JSON.stringify(documenterBaseURL) +
"," +
JSON.stringify(filters) +
")";
const worker_blob = new Blob([worker_str], { type: "text/javascript" });
const worker = new Worker(URL.createObjectURL(worker_blob));
/////// SEARCH MAIN ///////
// Whether the worker is currently handling a search. This is a boolean
// as the worker only ever handles 1 or 0 searches at a time.
var worker_is_running = false;
// The last search text that was sent to the worker. This is used to determine
// if the worker should be launched again when it reports back results.
var last_search_text = "";
// The results of the last search. This, in combination with the state of the filters
// in the DOM, is used compute the results to display on calls to update_search.
var unfiltered_results = [];
// Which filter is currently selected
var selected_filter = "";
$(document).on("input", ".documenter-search-input", function (event) {
if (!worker_is_running) {
launch_search();
}
});
function launch_search() {
worker_is_running = true;
last_search_text = $(".documenter-search-input").val();
worker.postMessage(last_search_text);
}
worker.onmessage = function (e) {
if (last_search_text !== $(".documenter-search-input").val()) {
launch_search();
} else {
worker_is_running = false;
}
unfiltered_results = e.data;
update_search();
};
$(document).on("click", ".search-filter", function () {
if ($(this).hasClass("search-filter-selected")) {
selected_filter = "";
} else {
selected_filter = $(this).text().toLowerCase();
}
// This updates search results and toggles classes for UI:
update_search();
});
/** /**
* Get selected filters, remake the filter html and lastly update the search modal * Make/Update the search component
*/ */
function get_filters() { function update_search() {
let ele = $(".search-filters .search-filter-selected").get(); let querystring = $(".documenter-search-input").val();
filter_results = ele.map((x) => $(x).text().toLowerCase());
modal_filters = make_modal_body_filters(filters, filter_results); if (querystring.trim()) {
update_search(filter_results); if (selected_filter == "") {
results = unfiltered_results;
} else {
results = unfiltered_results.filter((result) => {
return selected_filter == result.category.toLowerCase();
});
}
let search_result_container = ``;
let modal_filters = make_modal_body_filters();
let search_divider = `<div class="search-divider w-100"></div>`;
if (results.length) {
let links = [];
let count = 0;
let search_results = "";
for (var i = 0, n = results.length; i < n && count < 200; ++i) {
let result = results[i];
if (result.location && !links.includes(result.location)) {
search_results += result.div;
count++;
links.push(result.location);
}
}
if (count == 1) {
count_str = "1 result";
} else if (count == 200) {
count_str = "200+ results";
} else {
count_str = count + " results";
}
let result_count = `<div class="is-size-6">${count_str}</div>`;
search_result_container = `
<div class="is-flex is-flex-direction-column gap-2 is-align-items-flex-start">
${modal_filters}
${search_divider}
${result_count}
<div class="is-clipped w-100 is-flex is-flex-direction-column gap-2 is-align-items-flex-start has-text-justified mt-1">
${search_results}
</div>
</div>
`;
} else {
search_result_container = `
<div class="is-flex is-flex-direction-column gap-2 is-align-items-flex-start">
${modal_filters}
${search_divider}
<div class="is-size-6">0 result(s)</div>
</div>
<div class="has-text-centered my-5 py-5">No result found!</div>
`;
}
if ($(".search-modal-card-body").hasClass("is-justify-content-center")) {
$(".search-modal-card-body").removeClass("is-justify-content-center");
}
$(".search-modal-card-body").html(search_result_container);
} else {
if (!$(".search-modal-card-body").hasClass("is-justify-content-center")) {
$(".search-modal-card-body").addClass("is-justify-content-center");
}
$(".search-modal-card-body").html(`
<div class="has-text-centered my-5 py-5">Type something to get started!</div>
`);
}
}
/**
* Make the modal filter html
*
* @returns string
*/
function make_modal_body_filters() {
let str = filters
.map((val) => {
if (selected_filter == val.toLowerCase()) {
return `<a href="javascript:;" class="search-filter search-filter-selected"><span>${val}</span></a>`;
} else {
return `<a href="javascript:;" class="search-filter"><span>${val}</span></a>`;
}
})
.join("");
return `
<div class="is-flex gap-2 is-flex-wrap-wrap is-justify-content-flex-start is-align-items-center search-filters">
<span class="is-size-6">Filters:</span>
${str}
</div>`;
} }
}) })
@ -635,6 +792,7 @@ $(document).ready(function () {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
require(['jquery'], function($) { require(['jquery'], function($) {
$(document).ready(function () {
let search_modal_header = ` let search_modal_header = `
<header class="modal-card-head gap-2 is-align-items-center is-justify-content-space-between w-100 px-3"> <header class="modal-card-head gap-2 is-align-items-center is-justify-content-space-between w-100 px-3">
<div class="field mb-0 w-100"> <div class="field mb-0 w-100">
@ -684,7 +842,9 @@ document.querySelector(".docs-search-query").addEventListener("click", () => {
openModal(); openModal();
}); });
document.querySelector(".close-search-modal").addEventListener("click", () => { document
.querySelector(".close-search-modal")
.addEventListener("click", () => {
closeModal(); closeModal();
}); });
@ -732,6 +892,7 @@ document
.addEventListener("click", () => { .addEventListener("click", () => {
closeModal(); closeModal();
}); });
});
}) })
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

2
dev/assets/themes/documenter-dark.css

File diff suppressed because one or more lines are too long

2
dev/customprocessing/index.html

@ -26,4 +26,4 @@ include(&quot;file2.jl&quot;)</code></pre><p>Let&#39;s say we have saved this fi
end end
return str return str
end</code></pre><p>(of course replace <code>included</code> with your respective files)</p><p>Finally, you simply pass this function to e.g. <a href="../outputformats/#Literate.markdown"><code>Literate.markdown</code></a> as</p><pre><code class="language-julia hljs">Literate.markdown(&quot;examples.jl&quot;, &quot;path/to/save/markdown&quot;; end</code></pre><p>(of course replace <code>included</code> with your respective files)</p><p>Finally, you simply pass this function to e.g. <a href="../outputformats/#Literate.markdown"><code>Literate.markdown</code></a> as</p><pre><code class="language-julia hljs">Literate.markdown(&quot;examples.jl&quot;, &quot;path/to/save/markdown&quot;;
name = &quot;markdown_file_name&quot;, preprocess = replace_includes)</code></pre><p>and you will see that in the final output file (here <code>markdown_file_name.md</code>) the <code>include</code> statements are replaced with the actual code to be included!</p><p>This approach is used for generating <a href="https://juliadynamics.github.io/TimeseriesPrediction.jl/latest/stexamples/">the examples</a> in the documentation of the <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl">TimeseriesPrediction.jl</a> package. The <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl/tree/dcb080376a7861716147c04e45c473f55bb9a078/examples">example files</a>, included together in the <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl/blob/dcb080376a7861716147c04e45c473f55bb9a078/docs/src/stexamples.jl">stexamples.jl</a> file, are processed by literate via this <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl/blob/dcb080376a7861716147c04e45c473f55bb9a078/docs/make.jl">make.jl</a> file to generate the markdown and code cells of the documentation.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../outputformats/">« <strong>4.</strong> Output formats</a><a class="docs-footer-nextpage" href="../documenter/"><strong>6.</strong> Interaction with Documenter.jl »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> name = &quot;markdown_file_name&quot;, preprocess = replace_includes)</code></pre><p>and you will see that in the final output file (here <code>markdown_file_name.md</code>) the <code>include</code> statements are replaced with the actual code to be included!</p><p>This approach is used for generating <a href="https://juliadynamics.github.io/TimeseriesPrediction.jl/latest/stexamples/">the examples</a> in the documentation of the <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl">TimeseriesPrediction.jl</a> package. The <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl/tree/dcb080376a7861716147c04e45c473f55bb9a078/examples">example files</a>, included together in the <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl/blob/dcb080376a7861716147c04e45c473f55bb9a078/docs/src/stexamples.jl">stexamples.jl</a> file, are processed by literate via this <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl/blob/dcb080376a7861716147c04e45c473f55bb9a078/docs/make.jl">make.jl</a> file to generate the markdown and code cells of the documentation.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../outputformats/">« <strong>4.</strong> Output formats</a><a class="docs-footer-nextpage" href="../documenter/"><strong>6.</strong> Interaction with Documenter.jl »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

2
dev/documenter/index.html

@ -11,4 +11,4 @@ EditURL = &quot;$(relpath(inputfile, outputdir))&quot;
\int f dx \int f dx
$$</code></pre></li><li>Whereas Documenter requires HTML blocks to be escaped<pre><code class="nohighlight hljs">```@raw html $$</code></pre></li><li>Whereas Documenter requires HTML blocks to be escaped<pre><code class="nohighlight hljs">```@raw html
&lt;tag&gt;...&lt;/tag&gt; &lt;tag&gt;...&lt;/tag&gt;
```</code></pre>the output to a notebook markdown cell will be raw HTML<pre><code class="nohighlight hljs">&lt;tag&gt;...&lt;/tag&gt;</code></pre></li></ul><h3 id="[Literate.script](@ref):"><a class="docs-heading-anchor" href="#[Literate.script](@ref):"><a href="../outputformats/#Literate.script"><code>Literate.script</code></a>:</a><a id="[Literate.script](@ref):-1"></a><a class="docs-heading-anchor-permalink" href="#[Literate.script](@ref):" title="Permalink"></a></h3><ul><li>Documenter style <code>@ref</code>s and <code>@id</code> will be removed. This means that you can use <code>@ref</code> and <code>@id</code> in the source file without them leaking to the script.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../customprocessing/">« <strong>5.</strong> Custom pre- and post-processing</a><a class="docs-footer-nextpage" href="../tips/"><strong>7.</strong> Tips and tricks »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> ```</code></pre>the output to a notebook markdown cell will be raw HTML<pre><code class="nohighlight hljs">&lt;tag&gt;...&lt;/tag&gt;</code></pre></li></ul><h3 id="[Literate.script](@ref):"><a class="docs-heading-anchor" href="#[Literate.script](@ref):"><a href="../outputformats/#Literate.script"><code>Literate.script</code></a>:</a><a id="[Literate.script](@ref):-1"></a><a class="docs-heading-anchor-permalink" href="#[Literate.script](@ref):" title="Permalink"></a></h3><ul><li>Documenter style <code>@ref</code>s and <code>@id</code> will be removed. This means that you can use <code>@ref</code> and <code>@id</code> in the source file without them leaking to the script.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../customprocessing/">« <strong>5.</strong> Custom pre- and post-processing</a><a class="docs-footer-nextpage" href="../tips/"><strong>7.</strong> Tips and tricks »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

2
dev/fileformat/index.html

@ -29,4 +29,4 @@ blah blah blah
#md # Literate.notebook #md # Literate.notebook
#md # Literate.script #md # Literate.script
#md # ```</code></pre><p>The lines in the example above would be filtered out in the preprocessing step, unless we are generating a markdown file. When generating a markdown file we would simply remove the leading <code>#md</code> from the lines. Beware that the space after the tag is also removed.</p><p>The <code>#src</code> token can also be placed at the <em>end</em> of a line. This is to make it possible to have code lines exclusive to the source code, and not just comment lines. For example, if the source file is included in the test suite we might want to add a <code>@test</code> at the end without this showing up in the outputs:</p><pre><code class="language-julia hljs">using Test #src #md # ```</code></pre><p>The lines in the example above would be filtered out in the preprocessing step, unless we are generating a markdown file. When generating a markdown file we would simply remove the leading <code>#md</code> from the lines. Beware that the space after the tag is also removed.</p><p>The <code>#src</code> token can also be placed at the <em>end</em> of a line. This is to make it possible to have code lines exclusive to the source code, and not just comment lines. For example, if the source file is included in the test suite we might want to add a <code>@test</code> at the end without this showing up in the outputs:</p><pre><code class="language-julia hljs">using Test #src
@test result == expected_result #src</code></pre><h2 id="Default-replacements"><a class="docs-heading-anchor" href="#Default-replacements"><strong>2.3.</strong> Default replacements</a><a id="Default-replacements-1"></a><a class="docs-heading-anchor-permalink" href="#Default-replacements" title="Permalink"></a></h2><p>The following convenience &quot;macros&quot;/source placeholders are always expanded:</p><ul><li><p><code>@__NAME__</code>:</p><p>expands to the <code>name</code> keyword argument to <a href="../outputformats/#Literate.markdown"><code>Literate.markdown</code></a>, <a href="../outputformats/#Literate.notebook"><code>Literate.notebook</code></a> and <a href="../outputformats/#Literate.script"><code>Literate.script</code></a> (defaults to the filename of the input file).</p></li><li><p><code>@__REPO_ROOT_URL__</code>:</p><p>Can be used to link to files in the repository. For example <code>@__REPO_ROOT_URL__/src/Literate.jl</code> would link to the <a href="https://github.com/fredrikekre/Literate.jl/blob/master/src/Literate.jl">source of the Literate module</a>. This variable is automatically determined on Travis CI, GitHub Actions and GitLab CI, but can be configured, see <a href="../outputformats/#Configuration">Configuration</a>.</p></li><li><p><code>@__NBVIEWER_ROOT_URL__</code>:</p><p>Can be used if you want a link that opens the generated notebook in <a href="http://nbviewer.jupyter.org/">http://nbviewer.jupyter.org/</a>. This variable is automatically determined on Travis CI, GitHub Actions and GitLab CI, but can be configured, see <a href="../outputformats/#Configuration">Configuration</a>.</p></li><li><p><code>@__BINDER_ROOT_URL__</code>:</p><p>Can be used if you want a link that opens the generated notebook in <a href="https://mybinder.org/">https://mybinder.org/</a>. For example, to add a binder-badge in e.g. the HTML output you can use:</p><pre><code class="nohighlight hljs">[![Binder](https://mybinder.org/badge_logo.svg)](@__BINDER_ROOT_URL__/path/to/notebook.inpynb)</code></pre><p>This variable is automatically determined on Travis CI, GitHub Actions and GitLab CI, but can be configured, see <a href="../outputformats/#Configuration">Configuration</a>.</p></li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« <strong>1.</strong> Introduction</a><a class="docs-footer-nextpage" href="../pipeline/"><strong>3.</strong> Processing pipeline »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> @test result == expected_result #src</code></pre><h2 id="Default-replacements"><a class="docs-heading-anchor" href="#Default-replacements"><strong>2.3.</strong> Default replacements</a><a id="Default-replacements-1"></a><a class="docs-heading-anchor-permalink" href="#Default-replacements" title="Permalink"></a></h2><p>The following convenience &quot;macros&quot;/source placeholders are always expanded:</p><ul><li><p><code>@__NAME__</code>:</p><p>expands to the <code>name</code> keyword argument to <a href="../outputformats/#Literate.markdown"><code>Literate.markdown</code></a>, <a href="../outputformats/#Literate.notebook"><code>Literate.notebook</code></a> and <a href="../outputformats/#Literate.script"><code>Literate.script</code></a> (defaults to the filename of the input file).</p></li><li><p><code>@__REPO_ROOT_URL__</code>:</p><p>Can be used to link to files in the repository. For example <code>@__REPO_ROOT_URL__/src/Literate.jl</code> would link to the <a href="https://github.com/fredrikekre/Literate.jl/blob/master/src/Literate.jl">source of the Literate module</a>. This variable is automatically determined on Travis CI, GitHub Actions and GitLab CI, but can be configured, see <a href="../outputformats/#Configuration">Configuration</a>.</p></li><li><p><code>@__NBVIEWER_ROOT_URL__</code>:</p><p>Can be used if you want a link that opens the generated notebook in <a href="http://nbviewer.jupyter.org/">http://nbviewer.jupyter.org/</a>. This variable is automatically determined on Travis CI, GitHub Actions and GitLab CI, but can be configured, see <a href="../outputformats/#Configuration">Configuration</a>.</p></li><li><p><code>@__BINDER_ROOT_URL__</code>:</p><p>Can be used if you want a link that opens the generated notebook in <a href="https://mybinder.org/">https://mybinder.org/</a>. For example, to add a binder-badge in e.g. the HTML output you can use:</p><pre><code class="nohighlight hljs">[![Binder](https://mybinder.org/badge_logo.svg)](@__BINDER_ROOT_URL__/path/to/notebook.inpynb)</code></pre><p>This variable is automatically determined on Travis CI, GitHub Actions and GitLab CI, but can be configured, see <a href="../outputformats/#Configuration">Configuration</a>.</p></li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« <strong>1.</strong> Introduction</a><a class="docs-footer-nextpage" href="../pipeline/"><strong>3.</strong> Processing pipeline »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

130
dev/generated/example.ipynb

File diff suppressed because one or more lines are too long

64
dev/generated/example/10ff1d47.svg → dev/generated/example/1e7d4c4b.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

4
dev/generated/example/index.html

@ -13,7 +13,7 @@ foo()</code></pre><pre class="documenter-example-output"><code class="nohighligh
x = range(0, stop=6π, length=1000) x = range(0, stop=6π, length=1000)
y1 = sin.(x) y1 = sin.(x)
y2 = cos.(x) y2 = cos.(x)
plot(x, [y1, y2])</code></pre><img src="10ff1d47.svg" alt="Example block output"/><h3 id="Custom-processing"><a class="docs-heading-anchor" href="#Custom-processing">Custom processing</a><a id="Custom-processing-1"></a><a class="docs-heading-anchor-permalink" href="#Custom-processing" title="Permalink"></a></h3><p>It is possible to give Literate custom pre- and post-processing functions. For example, here we insert a placeholder value <code>y = 321</code> in the source, and use a preprocessing function that replaces it with <code>y = 321</code> in the rendered output.</p><pre><code class="language-julia hljs">x = 123</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">123</code></pre><p>In this case the preprocessing function is defined by</p><pre><code class="language-julia hljs">function pre(s::String) plot(x, [y1, y2])</code></pre><img src="1e7d4c4b.svg" alt="Example block output"/><h3 id="Custom-processing"><a class="docs-heading-anchor" href="#Custom-processing">Custom processing</a><a id="Custom-processing-1"></a><a class="docs-heading-anchor-permalink" href="#Custom-processing" title="Permalink"></a></h3><p>It is possible to give Literate custom pre- and post-processing functions. For example, here we insert a placeholder value <code>y = 321</code> in the source, and use a preprocessing function that replaces it with <code>y = 321</code> in the rendered output.</p><pre><code class="language-julia hljs">x = 123</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">123</code></pre><p>In this case the preprocessing function is defined by</p><pre><code class="language-julia hljs">function pre(s::String)
s = replace(s, &quot;x = 123&quot; =&gt; &quot;y = 321&quot;) s = replace(s, &quot;x = 123&quot; =&gt; &quot;y = 321&quot;)
return s return s
end</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">pre (generic function with 1 method)</code></pre><h3 id="documenter-interaction"><a class="docs-heading-anchor" href="#documenter-interaction">Documenter.jl interaction</a><a id="documenter-interaction-1"></a><a class="docs-heading-anchor-permalink" href="#documenter-interaction" title="Permalink"></a></h3><p>In the source file it is possible to use Documenter.jl style references, such as <code>@ref</code> and <code>@id</code>. These will be filtered out in the notebook output. For example, <a href="#documenter-interaction">here is a link</a>, but it is only visible as a link if you are reading the markdown output. We can also use equations:</p><p class="math-container">\[\int_\Omega \nabla v \cdot \nabla u\ \mathrm{d}\Omega = \int_\Omega v f\ \mathrm{d}\Omega\]</p><p>using Documenters math syntax. Documenters syntax is automatically changed to <code>\begin{equation} ... \end{equation}</code> in the notebook output to display correctly.</p><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../tips/">« <strong>7.</strong> Tips and tricks</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> end</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">pre (generic function with 1 method)</code></pre><h3 id="documenter-interaction"><a class="docs-heading-anchor" href="#documenter-interaction">Documenter.jl interaction</a><a id="documenter-interaction-1"></a><a class="docs-heading-anchor-permalink" href="#documenter-interaction" title="Permalink"></a></h3><p>In the source file it is possible to use Documenter.jl style references, such as <code>@ref</code> and <code>@id</code>. These will be filtered out in the notebook output. For example, <a href="#documenter-interaction">here is a link</a>, but it is only visible as a link if you are reading the markdown output. We can also use equations:</p><p class="math-container">\[\int_\Omega \nabla v \cdot \nabla u\ \mathrm{d}\Omega = \int_\Omega v f\ \mathrm{d}\Omega\]</p><p>using Documenters math syntax. Documenters syntax is automatically changed to <code>\begin{equation} ... \end{equation}</code> in the notebook output to display correctly.</p><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../tips/">« <strong>7.</strong> Tips and tricks</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

2
dev/generated/name/index.html

File diff suppressed because one or more lines are too long

2
dev/index.html

File diff suppressed because one or more lines are too long

BIN
dev/objects.inv

Binary file not shown.

4
dev/outputformats/index.html

File diff suppressed because one or more lines are too long

2
dev/pipeline/index.html

@ -29,4 +29,4 @@ x = 1 // 3
y = 2 // 5</code></pre><p>Chunk #3:</p><pre><code class="language-markdown hljs">When adding `x` and `y` together we obtain a new rational number:</code></pre><p>Chunk #4:</p><pre><code class="language-julia hljs">z = x + y</code></pre><p>It is then up to the <a href="#Document-generation">Document generation</a> step to decide how these chunks should be treated.</p><h3 id="Custom-control-over-chunk-splits"><a class="docs-heading-anchor" href="#Custom-control-over-chunk-splits">Custom control over chunk splits</a><a id="Custom-control-over-chunk-splits-1"></a><a class="docs-heading-anchor-permalink" href="#Custom-control-over-chunk-splits" title="Permalink"></a></h3><p>Sometimes it is convenient to be able to manually control how the chunks are split. For example, if you want to split a block of code into two, such that they end up in two different <code>@example</code> blocks or notebook cells. The <code>#-</code> token can be used for this purpose. All lines starting with <code>#-</code> are used as &quot;chunk-splitters&quot;:</p><pre><code class="language-julia hljs">x = 1 // 3 y = 2 // 5</code></pre><p>Chunk #3:</p><pre><code class="language-markdown hljs">When adding `x` and `y` together we obtain a new rational number:</code></pre><p>Chunk #4:</p><pre><code class="language-julia hljs">z = x + y</code></pre><p>It is then up to the <a href="#Document-generation">Document generation</a> step to decide how these chunks should be treated.</p><h3 id="Custom-control-over-chunk-splits"><a class="docs-heading-anchor" href="#Custom-control-over-chunk-splits">Custom control over chunk splits</a><a id="Custom-control-over-chunk-splits-1"></a><a class="docs-heading-anchor-permalink" href="#Custom-control-over-chunk-splits" title="Permalink"></a></h3><p>Sometimes it is convenient to be able to manually control how the chunks are split. For example, if you want to split a block of code into two, such that they end up in two different <code>@example</code> blocks or notebook cells. The <code>#-</code> token can be used for this purpose. All lines starting with <code>#-</code> are used as &quot;chunk-splitters&quot;:</p><pre><code class="language-julia hljs">x = 1 // 3
y = 2 // 5 y = 2 // 5
#- #-
z = x + y</code></pre><p>The example above would result in two consecutive code-chunks.</p><div class="admonition is-success"><header class="admonition-header">Tip</header><div class="admonition-body"><p>The rest of the line, after <code>#-</code>, is discarded, so it is possible to use e.g. <code>#-------------</code> as a chunk splitter, which may make the source code more readable.</p></div></div><p>It is also possible to use <code>#+</code> as a chunk splitter. The difference between <code>#+</code> and <code>#-</code> is that <code>#+</code> enables Documenter&#39;s &quot;continued&quot;-blocks, see the <a href="https://juliadocs.github.io/Documenter.jl/stable/">Documenter manual</a>.</p><h2 id="Document-generation"><a class="docs-heading-anchor" href="#Document-generation"><strong>3.3.</strong> Document generation</a><a id="Document-generation-1"></a><a class="docs-heading-anchor-permalink" href="#Document-generation" title="Permalink"></a></h2><p>After the parsing it is time to generate the output. What is done in this step is very different depending on the output target, and it is described in more detail in the Output format sections: <a href="../outputformats/#Markdown-output">Markdown output</a>, <a href="../outputformats/#Notebook-output">Notebook output</a> and <a href="../outputformats/#Script-output">Script output</a>. Using the default settings, the following is happening:</p><ul><li>Markdown output: markdown chunks are printed as-is, code chunks are put inside a code fence (defaults to <code>@example</code>-blocks),</li><li>Notebook output: markdown chunks are printed in markdown cells, code chunks are put in code cells,</li><li>Script output: markdown chunks are discarded, code chunks are printed as-is.</li></ul><h2 id="Post-processing"><a class="docs-heading-anchor" href="#Post-processing"><strong>3.4.</strong> Post-processing</a><a id="Post-processing-1"></a><a class="docs-heading-anchor-permalink" href="#Post-processing" title="Permalink"></a></h2><p>When the document is generated the user, again, has the option to hook-into the generation with a custom post-processing function. The reason is that one might want to change things that are only visible in the rendered document. See <a href="../customprocessing/#Custom-pre-and-post-processing">Custom pre- and post-processing</a>.</p><h2 id="Writing-to-file"><a class="docs-heading-anchor" href="#Writing-to-file"><strong>3.5.</strong> Writing to file</a><a id="Writing-to-file-1"></a><a class="docs-heading-anchor-permalink" href="#Writing-to-file" title="Permalink"></a></h2><p>The last step of the generation is writing to file. The result is written to <code>$(outputdir)/$(name)(.md|.ipynb|.jl)</code> where <code>outputdir</code> is the output directory supplied by the user (for example <code>docs/generated</code>), and <code>name</code> is a user supplied filename. It is recommended to add the output directory to <code>.gitignore</code> since the idea is that the generated documents will be generated as part of the build process rather than being files in the repo.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../fileformat/">« <strong>2.</strong> File format</a><a class="docs-footer-nextpage" href="../outputformats/"><strong>4.</strong> Output formats »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> z = x + y</code></pre><p>The example above would result in two consecutive code-chunks.</p><div class="admonition is-success"><header class="admonition-header">Tip</header><div class="admonition-body"><p>The rest of the line, after <code>#-</code>, is discarded, so it is possible to use e.g. <code>#-------------</code> as a chunk splitter, which may make the source code more readable.</p></div></div><p>It is also possible to use <code>#+</code> as a chunk splitter. The difference between <code>#+</code> and <code>#-</code> is that <code>#+</code> enables Documenter&#39;s &quot;continued&quot;-blocks, see the <a href="https://juliadocs.github.io/Documenter.jl/stable/">Documenter manual</a>.</p><h2 id="Document-generation"><a class="docs-heading-anchor" href="#Document-generation"><strong>3.3.</strong> Document generation</a><a id="Document-generation-1"></a><a class="docs-heading-anchor-permalink" href="#Document-generation" title="Permalink"></a></h2><p>After the parsing it is time to generate the output. What is done in this step is very different depending on the output target, and it is described in more detail in the Output format sections: <a href="../outputformats/#Markdown-output">Markdown output</a>, <a href="../outputformats/#Notebook-output">Notebook output</a> and <a href="../outputformats/#Script-output">Script output</a>. Using the default settings, the following is happening:</p><ul><li>Markdown output: markdown chunks are printed as-is, code chunks are put inside a code fence (defaults to <code>@example</code>-blocks),</li><li>Notebook output: markdown chunks are printed in markdown cells, code chunks are put in code cells,</li><li>Script output: markdown chunks are discarded, code chunks are printed as-is.</li></ul><h2 id="Post-processing"><a class="docs-heading-anchor" href="#Post-processing"><strong>3.4.</strong> Post-processing</a><a id="Post-processing-1"></a><a class="docs-heading-anchor-permalink" href="#Post-processing" title="Permalink"></a></h2><p>When the document is generated the user, again, has the option to hook-into the generation with a custom post-processing function. The reason is that one might want to change things that are only visible in the rendered document. See <a href="../customprocessing/#Custom-pre-and-post-processing">Custom pre- and post-processing</a>.</p><h2 id="Writing-to-file"><a class="docs-heading-anchor" href="#Writing-to-file"><strong>3.5.</strong> Writing to file</a><a id="Writing-to-file-1"></a><a class="docs-heading-anchor-permalink" href="#Writing-to-file" title="Permalink"></a></h2><p>The last step of the generation is writing to file. The result is written to <code>$(outputdir)/$(name)(.md|.ipynb|.jl)</code> where <code>outputdir</code> is the output directory supplied by the user (for example <code>docs/generated</code>), and <code>name</code> is a user supplied filename. It is recommended to add the output directory to <code>.gitignore</code> since the idea is that the generated documents will be generated as part of the build process rather than being files in the repo.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../fileformat/">« <strong>2.</strong> File format</a><a class="docs-footer-nextpage" href="../outputformats/"><strong>4.</strong> Output formats »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

2
dev/reference/index.html

File diff suppressed because one or more lines are too long

2
dev/tips/index.html

@ -27,4 +27,4 @@ Literate.notebook(&quot;example.jl&quot;, &quot;tmp/&quot;; preprocess = nb_note
This is a useful note.</code></pre><p>and a quotation style formatting in the generated notebook cell:</p><pre><code class="language-julia hljs">&gt; *Note* This is a useful note.</code></pre><p>and a quotation style formatting in the generated notebook cell:</p><pre><code class="language-julia hljs">&gt; *Note*
&gt; This is a useful note.</code></pre><p>which, in an actual notebook cell, will look similar to:</p><blockquote><p><em>Note</em><br/>This is a useful note.</p></blockquote><h3 id="debug-execution"><a class="docs-heading-anchor" href="#debug-execution">Debugging code execution</a><a id="debug-execution-1"></a><a class="docs-heading-anchor-permalink" href="#debug-execution" title="Permalink"></a></h3><p>When Literate is executing code (i.e. when <code>execute = true</code> is set), it does so quietly. All the output gets captured and nothing gets printed into the terminal. This can make it tricky to know where things go wrong, e.g. when the execution stalls due to an infinite loop.</p><p>To help debug this, Literate has an <code>@debug</code> statement that prints out each code block that is being executed. In general, to enable the printing of Literate&#39;s <code>@debug</code> statements, you can set the <code>JULIA_DEBUG</code> environment variable to <code>&quot;Literate&quot;</code>.</p><p>The easiest way to do that is to set the variable in the Julia session before running Literate by doing</p><pre><code class="language-julia hljs">ENV[&quot;JULIA_DEBUG&quot;]=&quot;Literate&quot;</code></pre><p>Alternatively, you can also set the environment variable before starting the Julia session, e.g.</p><pre><code class="language-sh hljs">$ JULIA_DEBUG=Literate julia</code></pre><p>or by wrapping the Literate calls in an <code>withenv</code> block</p><pre><code class="language-julia hljs">withenv(&quot;JULIA_DEBUG&quot; =&gt; &quot;Literate&quot;) do &gt; This is a useful note.</code></pre><p>which, in an actual notebook cell, will look similar to:</p><blockquote><p><em>Note</em><br/>This is a useful note.</p></blockquote><h3 id="debug-execution"><a class="docs-heading-anchor" href="#debug-execution">Debugging code execution</a><a id="debug-execution-1"></a><a class="docs-heading-anchor-permalink" href="#debug-execution" title="Permalink"></a></h3><p>When Literate is executing code (i.e. when <code>execute = true</code> is set), it does so quietly. All the output gets captured and nothing gets printed into the terminal. This can make it tricky to know where things go wrong, e.g. when the execution stalls due to an infinite loop.</p><p>To help debug this, Literate has an <code>@debug</code> statement that prints out each code block that is being executed. In general, to enable the printing of Literate&#39;s <code>@debug</code> statements, you can set the <code>JULIA_DEBUG</code> environment variable to <code>&quot;Literate&quot;</code>.</p><p>The easiest way to do that is to set the variable in the Julia session before running Literate by doing</p><pre><code class="language-julia hljs">ENV[&quot;JULIA_DEBUG&quot;]=&quot;Literate&quot;</code></pre><p>Alternatively, you can also set the environment variable before starting the Julia session, e.g.</p><pre><code class="language-sh hljs">$ JULIA_DEBUG=Literate julia</code></pre><p>or by wrapping the Literate calls in an <code>withenv</code> block</p><pre><code class="language-julia hljs">withenv(&quot;JULIA_DEBUG&quot; =&gt; &quot;Literate&quot;) do
Literate.notebook(&quot;myscript.jl&quot;; execute=true) Literate.notebook(&quot;myscript.jl&quot;; execute=true)
end</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../documenter/">« <strong>6.</strong> Interaction with Documenter.jl</a><a class="docs-footer-nextpage" href="../generated/example/"><strong>8.</strong> Example »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> end</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../documenter/">« <strong>6.</strong> Interaction with Documenter.jl</a><a class="docs-footer-nextpage" href="../generated/example/"><strong>8.</strong> Example »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Sunday 14 April 2024 12:02">Sunday 14 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

Loading…
Cancel
Save