From d4622e0592b35207132c55d4183bb723457e39fe Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 26 Mar 2024 10:50:41 +0100 Subject: [PATCH] utils/generate-module-api-doc.rb: update for redict.io Signed-off-by: Drew DeVault --- utils/generate-module-api-doc.rb | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/utils/generate-module-api-doc.rb b/utils/generate-module-api-doc.rb index aef8245d2..ebaafb844 100755 --- a/utils/generate-module-api-doc.rb +++ b/utils/generate-module-api-doc.rb @@ -87,7 +87,7 @@ def docufy(src,i) puts "\n\n" puts "### `#{name}`\n\n" puts " #{proto}\n" - puts "**Available since:** #{$since[name] or "unreleased"}\n\n" + puts "**Available since:** #{$since[name] or "Redict 7.3.0"}\n\n" comment = "" while true i = i-1 @@ -145,18 +145,14 @@ def is_func_line(src, i) end puts "---\n" -puts "title: \"Modules API reference\"\n" -puts "linkTitle: \"API reference\"\n" -puts "weight: 1\n" -puts "description: >\n" -puts " Reference for the Redict Modules API\n" -puts "aliases:\n" -puts " - /topics/modules-api-ref\n" +puts "title: \"API reference\"\n" puts "---\n" puts "\n" puts "\n\n" -src = File.open(File.dirname(__FILE__) ++ "/../src/module.c").to_a +puts "# Modules API reference" + +src = File.open("src/module.c").to_a # Build function index $index = {} @@ -186,16 +182,6 @@ if File.directory?(git_dir) && `which git` != "" end end -# Print TOC -puts "## Sections\n\n" -src.each_with_index do |_line,i| - if is_section_doc(src, i) - name = get_section_heading(src, i) - puts "* [#{name}](\##{section_name_to_id(name)})\n" - end -end -puts "* [Function index](#section-function-index)\n\n" - # Docufy: Print function prototype and markdown docs src.each_with_index do |_line,i| if is_func_line(src, i)