pandoc-9-lua-filters

Sub-skill of pandoc: 9. Lua Filters.

5 stars

Best use case

pandoc-9-lua-filters is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Sub-skill of pandoc: 9. Lua Filters.

Teams using pandoc-9-lua-filters should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/9-lua-filters/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_archive/development/documentation/pandoc/9-lua-filters/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/9-lua-filters/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pandoc-9-lua-filters Compares

Feature / Agentpandoc-9-lua-filtersStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Sub-skill of pandoc: 9. Lua Filters.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 9. Lua Filters

## 9. Lua Filters


```lua
-- filters/word-count.lua
-- Count words in document

local word_count = 0

function Str(el)
    word_count = word_count + 1
    return el
end

function Pandoc(doc)
    print("Word count: " .. word_count)
    return doc
end
```

```lua
-- filters/uppercase-headers.lua
-- Convert all headers to uppercase

function Header(el)
    return pandoc.walk_block(el, {
        Str = function(s)
            return pandoc.Str(string.upper(s.text))
        end
    })
end
```

```lua
-- filters/remove-links.lua
-- Remove all hyperlinks, keeping text

function Link(el)
    return el.content
end
```

```lua
-- filters/custom-blocks.lua
-- Convert custom div blocks to styled output

function Div(el)
    if el.classes:includes("warning") then
        -- For LaTeX output
        local latex_begin = pandoc.RawBlock('latex',
            '\\begin{tcolorbox}[colback=yellow!10,colframe=orange]')
        local latex_end = pandoc.RawBlock('latex', '\\end{tcolorbox}')

        table.insert(el.content, 1, latex_begin)
        table.insert(el.content, latex_end)
        return el.content
    end

    if el.classes:includes("info") then
        local latex_begin = pandoc.RawBlock('latex',
            '\\begin{tcolorbox}[colback=blue!5,colframe=blue!50]')
        local latex_end = pandoc.RawBlock('latex', '\\end{tcolorbox}')

        table.insert(el.content, 1, latex_begin)
        table.insert(el.content, latex_end)
        return el.content
    end
end
```

```lua
-- filters/include-files.lua
-- Include content from external files

function CodeBlock(el)
    if el.classes:includes("include") then
        local file = io.open(el.text, "r")
        if file then
            local content = file:read("*all")
            file:close()

            -- Get file extension for syntax highlighting
            local ext = el.text:match("%.(%w+)$")
            local lang = ext or ""

            return pandoc.CodeBlock(content, {class = lang})
        end
    end
end
```

```bash
# Use Lua filters
pandoc document.md -o document.pdf \
    --lua-filter=filters/uppercase-headers.lua \
    --lua-filter=filters/custom-blocks.lua

# Chain multiple filters
pandoc document.md -o document.pdf \
    --filter pandoc-crossref \
    --lua-filter=filters/custom-blocks.lua \
    --citeproc
```

Related Skills

pandoc-subsection

5
from vamseeachanta/workspace-hub

Sub-skill of pandoc: Subsection.

pandoc-integration-with-git-hooks

5
from vamseeachanta/workspace-hub

Sub-skill of pandoc: Integration with Git Hooks (+1).

pandoc-7-citations-and-bibliography

5
from vamseeachanta/workspace-hub

Sub-skill of pandoc: 7. Citations and Bibliography (+1).

pandoc-5-custom-latex-templates

5
from vamseeachanta/workspace-hub

Sub-skill of pandoc: 5. Custom LaTeX Templates (+1).

pandoc-2-image-management

5
from vamseeachanta/workspace-hub

Sub-skill of pandoc: 2. Image Management (+2).

pandoc-11-makefile-for-document-projects

5
from vamseeachanta/workspace-hub

Sub-skill of pandoc: 11. Makefile for Document Projects (+1).

pandoc-10-batch-conversion-scripts

5
from vamseeachanta/workspace-hub

Sub-skill of pandoc: 10. Batch Conversion Scripts.

pandoc-1-basic-format-conversion

5
from vamseeachanta/workspace-hub

Sub-skill of pandoc: 1. Basic Format Conversion (+3).

docx-extract-text-with-pandoc

5
from vamseeachanta/workspace-hub

Sub-skill of docx: Extract Text with Pandoc (+2).

test-oversized-skill

5
from vamseeachanta/workspace-hub

A test fixture skill that exceeds 200 lines with multiple H2/H3 sections for split testing.

interactive-report-generator

5
from vamseeachanta/workspace-hub

Generate interactive HTML reports with Plotly visualizations from data analysis results. Supports dashboards, charts, and professional styling.

data-validation-reporter

5
from vamseeachanta/workspace-hub

Generate interactive validation reports with quality scoring, missing data analysis, and type checking. Combines Pandas validation, Plotly visualization, and YAML configuration for comprehensive data quality reporting.