Files
klammertext/sks/document/heading.h
Andy Kopra 2ba7ceee7a Initial commit: Klammertext source distribution
Curated source subset assembled by klammertext-dev's doc/make_dist.sh: the Klammermachine (mac), the Standard Klammer Set (sks), the commands (com), editor plugins and install guides (doc), a test subset (tst), and lib/bin placeholders. Builds with 'make -C com'.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 19:32:38 +02:00

42 lines
1.3 KiB
C++

#pragma once
#include <string>
#include <vector>
#include <iostream>
const std::string link_delimiter { "%" };
class Heading {
public:
Heading(int level, std::string filename, std::string section, std::string id,
std::string number, std::string title)
: m_level(level), m_filename(filename), m_section(section), m_id(id),
m_number(number), m_title(title)
{};
int m_level {};
std::string m_filename {};
std::string m_section {};
std::string m_id {};
std::string m_number {};
std::string m_title {};
};
std::ostream& operator<<(std::ostream& os, const Heading h);
/*
std::tuple<std::string, std::vector<Heading>, std::vector<unsigned int>, unsigned int>
add_section_numbers(std::string s, std::string basename, std::vector<unsigned int> levels, unsigned int initial_id,
std::map<std::string, std::string>& section_id_map);
*/
std::string make_html_table_of_contents(std::vector<Heading> headings);
std::pair<int, std::string>
make_navigation_table_of_contents(std::vector<Heading> headings);
void show_table_of_contents(
std::string kt_filename, std::string title, std::vector<Heading> headings);
std::string cache_table_of_contents(
std::string kt_root_filename, std::string title, std::vector<Heading> headings);