Skip to content

Instantly share code, notes, and snippets.

@BobToninho
Created June 26, 2023 10:58
Show Gist options
  • Save BobToninho/25c0c3dfc99749a745752846004f8e0e to your computer and use it in GitHub Desktop.
Save BobToninho/25c0c3dfc99749a745752846004f8e0e to your computer and use it in GitHub Desktop.
Define an utility function for converting markdown files to odt together with the script to use it
ls *.md | each { |it| $it.name | parse '{file_name}.{extension}' | get file_name } | flatten | each { |it| to-odt $it }
def to-odt [file_name: string] {
let source = $file_name + ".md"
let target = $file_name + ".odt"
pandoc $source -f markdown -t odt -s -o $target
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment