Skip to content

Instantly share code, notes, and snippets.

@managedkaos
Created August 10, 2024 20:40
Show Gist options
  • Select an option

  • Save managedkaos/d084d17eb0d76a678051dc04615e47b1 to your computer and use it in GitHub Desktop.

Select an option

Save managedkaos/d084d17eb0d76a678051dc04615e47b1 to your computer and use it in GitHub Desktop.

Revisions

  1. managedkaos created this gist Aug 10, 2024.
    14 changes: 14 additions & 0 deletions convert-html-to-markdown.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    wget --mirror \
    --convert-links \
    --adjust-extension \
    --page-requisites \
    --no-parent ${WEBSITE:-https://example.com}

    for i in $(find . -type f -name index.html | grep -v -E "(tag|feed)");
    do
    path=$(dirname ${i})
    echo ${path}
    npx @wcj/html-to-markdown-cli $i --output=${path};
    done

    find . -type f -name index.html.md