### Markdown Table Example
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/markdown.md
Shows the markdown syntax for creating tables, including alignment specifications for columns.
```markdown
| Tables | Are | Cool |
|----------|:-------------:|------:|
| col 1 is | left-aligned | $1600 |
| col 2 is | centered | $12 |
| col 3 is | right-aligned | $1 |
```
--------------------------------
### Embedded XML Example
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/markdown.md
An example of XML content that can be embedded within markdown files. This snippet demonstrates basic XML structure.
```xml
November 15, 1957
Dearest Wm:
```
--------------------------------
### Markdown Blockquote Example
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/markdown.md
Demonstrates how to create blockquotes in markdown for citing external content or highlighting specific text.
```markdown
> Good luck in your interview. If you are wholly at your ease - and why not? - all will go well.
> But try to raise some sort of enthusiasm for your proposed career: dont-care-ism doesn't go down well.
```
--------------------------------
### Print Preview JavaScript Configuration
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/print-preview.html
Configuration object for enabling toolbar, menubar, and subscribing to progress events in the print preview.
```json
{
"features": {
"toolbar": {
"enabled": false
},
"menubar": false,
"progress": {
"subscribe": "preview"
}
},
"styles": [
"resources/css/print-preview.css"
],
"templating": {
"extends": "templates/layouts/base.html"
}
}
```
--------------------------------
### Markdown Preview Configuration
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/markdown-preview.html
Configuration object for templating, features like toolbar, registration, and timeline.
```json
{
"templating": {
"extends": "templates/layouts/base.html"
},
"features": {
"toolbar": {
"enabled": true,
"navigation": false,
"zoom": false
},
"register": {
"enabled": false
},
"timeline": {
"enabled": false,
"document-view": false
}
}
}
```
--------------------------------
### Download Menu Options
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/menu.html
Conditionally displays download options for a document. Includes options for editing XML, viewing XML, and downloading in various formats like Print CSS, LaTeX, and ePUB, based on media context.
```HTML/XSLT
[# display download menu if in document view #]
[% if exists($context?doc) and $menu?download %]
Download
* Edit XML
* [View XML]([[ $context-path ]]/api/document/[[ $context?doc?path ]] "download-tei")
[% if empty($context?media) or "print" = $context?media %]
* [Print CSS]([[ $context-path ]]/print/[[ $context?doc?path ]]?odd=[[$context?doc?odd]])
[% endif %]
[% if empty($context?media) or "latex" = $context?media %]
* Download
[% endif %]
[% if empty($context?media) or "latex" = $context?media %]
[% endif %]
[% if empty($context?media) or "fo" = $context?media %]
[% endif %]
[% if empty($context?media) or "fo" = $context?media %]
[% endif %]
[% if empty($context?media) or "epub" = $context?media %]
* ePUB
[% endif %]
[% block menu.download %][% endblock %]
[% endif %]
```
--------------------------------
### Admin Menu Options
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/menu.html
Provides administrative links, including editing ODD files, accessing API documentation, and downloading the application. It iterates through available ODD files to create edit links.
```HTML/XSLT
* Admin
[% for $odd in $config:odd-available %]
* [Edit ODD: [[$odd]]]([[$context-path]]/odd-editor.html?odd=[[$odd]])
[% endfor %]
* [API Documentation]([[ $context-path ]]/api.html)
* [Webcomponents API](https://cdn.tei-publisher.com/)
* Download App as .xar
[% block menu.admin %][% endblock %]
```
--------------------------------
### Markdown Image Syntax
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/markdown.md
Illustrates the markdown syntax for embedding images. The path specifies the location of the image resource.
```markdown

```
--------------------------------
### Print Preview Event Listeners
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/print-preview.html
JavaScript code to handle print, close, preview toggle, and URL copy actions for the print preview component.
```javascript
[% template scripts %]
document.addEventListener('DOMContentLoaded', function() {
const preview = document.querySelector('pb-print-preview');
const btn = document.getElementById('print-action');
btn.addEventListener('click', function() {
preview.print();
});
const closeBtn = document.getElementById('close-action');
closeBtn.addEventListener('click', function() {
window.close();
});
const previewToggle = document.getElementById('preview-toggle');
previewToggle.addEventListener('change', function(ev) {
const checked = ev.target.checked;
preview.raw = !checked;
preview.refresh();
});
const copyBtn = document.getElementById('copy-action');
copyBtn.addEventListener('click', function() {
const url = new URL(preview.getAttribute('url'), location.href);
console.log('Copying URL: %s', url.toString());
navigator.clipboard.writeText(url.toString());
});
});
[% endtemplate %]
```
--------------------------------
### Dynamic Navigation Menu Generation
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/menu.html
Generates main navigation links based on menu items. Supports external URLs and internal links, constructing URLs with context path and replacing 'browse.html' with a configured browse path.
```HTML/XSLT
[% for $item in $menu?items?* %]
[% if $item?url or $item?url = ''%]
[% let $url = if (starts-with($item?url, 'http')) then $item?url else $context-path || '/' || $item?url %]
[ [ $item?id ] ]( [[ replace($url, 'browse.html', $context?defaults?browse) ]] )
[% endlet %]
[% elif exists($item?subitems) %]
[ [ $item?id ] ]
[% for $subitem in $item?subitems?* %]
[ [ [ $subitem?id ] ] ]( [[ $context-path ]]/[[ replace($subitem?url, 'browse.html', $context?defaults?browse) ]] )
[% endfor %]
[% endif %]
[% endfor %]
```
--------------------------------
### Default Templating Configuration
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/markdown.md
Specifies the default HTML template to be used for rendering markdown content. This configuration can be overridden.
```json
{
"templating": {
"extends": "templates/layouts/markdown.html"
}
}
```
--------------------------------
### Displaying Generated XQuery Code
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/error-page.html
Shows the XQuery code generated from the template when a dynamic error occurs, using a jinn-codemirror component for syntax highlighting.
```html
[% if ends-with($type, ':error-dynamic') %]
XQuery code the template was translated into:
[%
endif
%]
```
--------------------------------
### Displaying Documents in TEI Publisher
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/documents.html
This template logic iterates through a list of documents and displays them. It includes conditional rendering for headers, search hits, and download options based on document media types and user permissions.
```HTML/Template
[# Receives a list of documents to display in $documents #]
[% if empty($documents) %]* ##### No documents
[% else %] [% for $doc in $documents %] [% let $options = browse:document-options($doc) %]* [[
browse:header($context, $doc, $options)
]]
[[
browse:show-hits($context, $doc)
]]
[% if $menu?download %] Download
* XML
[% if empty($options?media) or "print" = $options?media %]* [Print CSS]([[ $context-path ]]/print/[[ $options?relpath ]]?odd=[[$options?odd]])
[% endif %] [% if empty($options?media) or "latex" = $options?media %]* Download
[% endif %] [% if empty($options?media) or "latex" = $options?media %]
[% endif %] [% if empty($options?media) or "fo" = $options?media %]
[% endif %] [% if empty($options?media) or "fo" = $options?media %]
[% endif %] [% if empty($options?media) or "epub" = $options?media %]* ePUB
[% endif %] [% block document-download %][% endblock %]
[% endif %] [% block document-actions %][% endblock %] [% if $menu?delete %]
### Delete
[% endif %]
[% endlet %] [% endfor %] [% endif %]
```
--------------------------------
### Template Styles for Markdown
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/markdown-preview.html
Defines CSS variables for markdown preview, including code highlighting with pre-wrap whitespace.
```html
[% template styles %]
pb-markdown {
max-width: var(--pb-view-max-width);
--pb-code-highlight-white-space: pre-wrap;
}
[% endtemplate %]
```
--------------------------------
### Language Selection Menu
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/menu.html
Displays available language options for the user interface. It filters and lists languages based on the context's default languages.
```HTML/XSLT
[% if $menu?language %]
[% for $lang in filter(map:keys($languages), function($lang) { contains($context?defaults?languages?*, $lang) }) %]
[ [ $languages?($lang) ] ]
[% endfor %]
[% endif %]
```
--------------------------------
### Displaying Full Error Description
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/error-page.html
Renders the detailed error description provided by the system within a preformatted text block.
```html
Full error details:
[[$description]]
```
--------------------------------
### Breadcrumb Navigation Template
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/markdown-preview.html
Template for breadcrumb navigation, showing document path and collection link.
```html
[% template! breadcrumb %]
* * [Documents]([[ $context-path ]]/browse.html?collection=[[ browse:parent-link($context) ]])
* [document path]([[ $context-path ]]/[[ $doc?path ]])
[% endtemplate %]
```
--------------------------------
### Error Page HTML Structure
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/error-page.html
The main HTML structure for the error page, including header, navigation, and main content area. It displays the error type and detailed description.
```html
Error
An error occurred – [[$type]]
[%
if ends-with($type, ':error-dynamic') %
The system encountered a dynamic error rendering the HTML template. This might be due to a problem in the template itself or an XQuery module being imported.
The XQuery code the template was compiled into and which triggered the error is display at the bottom.
[%
elif ends-with($type, ':error-include') %
A file included into the HTML template being rendered could not be found.
[%
elif ends-with($type, ':error-extends') %
A base template extended by the HTML template could not be found.
[%
elif ends-with($type, ':error-eof') %
An error in the templating syntax prevented it from being rendered. This might be due to a missing "endXXX" marker. See details below.
[%
elif ends-with($type, ':error-syntax') %
An error in the templating syntax prevented it from being rendered. This is likely due to an unknown expression being used.
[%
endif
%]
Full error details:
[[$description]]
[%
if ends-with($type, ':error-dynamic') %
XQuery code the template was translated into:
[%
endif
%]
```
--------------------------------
### Conditional Error Messages
Source: https://github.com/eeditiones/tei-publisher-app/blob/master/templates/error-page.html
Displays specific user-friendly messages based on the type of error encountered during template rendering.
```html
[% if ends-with($type, ':error-dynamic') %]
The system encountered a dynamic error rendering the HTML template. This might be due to a problem in the template itself or an XQuery module being imported.
The XQuery code the template was compiled into and which triggered the error is display at the bottom.
[% elif ends-with($type, ':error-include') %]
A file included into the HTML template being rendered could not be found.
[% elif ends-with($type, ':error-extends') %]
A base template extended by the HTML template could not be found.
[% elif ends-with($type, ':error-eof') %]
An error in the templating syntax prevented it from being rendered. This might be due to a missing "endXXX" marker. See details below.
[% elif ends-with($type, ':error-syntax') %]
An error in the templating syntax prevented it from being rendered. This is likely due to an unknown expression being used.
[% endif %]
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.