2
0

build.sh 848 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh -e
  2. # Split lua_api.md on top level headings
  3. cat ../lua_api.md | csplit -sz -f docs/section - '/^=/-1' '{*}'
  4. cat > mkdocs.yml << EOF
  5. site_name: Luanti API Documentation
  6. theme:
  7. name: readthedocs
  8. highlightjs: False
  9. extra_css:
  10. - css/code_styles.css
  11. - css/extra.css
  12. markdown_extensions:
  13. - toc:
  14. permalink: True
  15. - pymdownx.superfences
  16. - pymdownx.highlight:
  17. css_class: codehilite
  18. - gfm_admonition
  19. plugins:
  20. - search:
  21. separator: '[\s\-\.\(]+'
  22. nav:
  23. - "Home": index.md
  24. EOF
  25. mv docs/section00 docs/index.md
  26. for f in docs/section*
  27. do
  28. title=$(head -1 $f)
  29. fname=$(echo $title | tr '[:upper:]' '[:lower:]')
  30. fname=$(echo $fname | sed 's/ /-/g')
  31. fname=$(echo $fname | sed "s/'//g").md
  32. mv $f docs/$fname
  33. echo "- \"$title\": $fname" >> mkdocs.yml
  34. done
  35. mkdocs build --site-dir ../../public