> For the complete documentation index, see [llms.txt](https://docs.eduplex.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eduplex.eu/documentation/how-to-export-documentation.md).

# How to export documentation

## Pandoc

Using GitBook, all our documentation is in **markdown** format. When we want to export it in another formar we use [Pandoc](https://pandoc.org/), a command line tool which allows to convert from one format to another. On their website there is a [guide](https://pandoc.org/getting-started.html) on how to install it and how to use it.

Pandoc allows to convert from markdown to many formats but currently we are using **markdown** to **docx**.

## Lua filters

There is a problem with images because in markdown they can be in HTML format, GitBook also inserts images in HTML, but Pandoc is not able to parse HTML images inside markdown files. So we have created a [Lua filter](https://pandoc.org/lua-filters.html) to parse those HTML images into a valid format for Pandoc to be able to transform them into the desired format.

```
function convertHtmlImageToMarkdownImage (elem)
    if elem.tag == "RawInline" and elem.format == "html" and elem.text:match '%<img' then
        local imgHtml = elem.text
        local alt = imgHtml:match('alt="(.-)"') or ""
        local src = imgHtml:match('src="(.-)"') or ""
        local title = imgHtml:match('title="(.-)"') or ""
        return pandoc.Image({}, src, title, alt)
    end
end
return {
    {RawInline = convertHtmlImageToMarkdownImage}
}

```

{% file src="/files/SeO7wUOCsx8eiHN8MvnH" %}

Lua filters can be used specifying the route of the file when using the convert command.

```
pandoc --lua-filter ./htmlImageParser.lua
```

## Example

With all the files in your local, just open a terminal and use the following command:

```
pandoc example.md --file-scope=true --lua-filter=htmlImageParser.lua -o exampleOutput.docx
```

* example.md: This is the original file we want to convert. If you want to include more than one file in the final document just write them separated by spaces.
* \--file-scope: It is a parameter we use for the annotations and footnotes to be included in the same page. Check Pandoc parameters [documentation](https://pandoc.org/MANUAL.html#option--file-scope\[).
* -lua-filter: As mentioned on the previous section, this allows us to execute some code to transform the images into a valid format.
* -o exampleOutput.docx: The name of the generated file. Since we are not specifying the output format, it takes it from the file extension.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eduplex.eu/documentation/how-to-export-documentation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
