Klammerset: the @@@klammerset construct, its search path, and const correctness
The @@@klammerset system command formally declares a klammerset — a named, logically related group of klammer definitions — with an operative, idempotent declaration (:requires and :files load in order at the declaration point, relative to the declaring file). A bare symbol given to ktext -k, kdesc --input, or :requires resolves to x/x.k on the search path: the document's directory, then KLAMMERTEXT_KLAMMERSETS, then KLAMMERTEXT_HOME; kdesc --klammerset lists the available sets. sks/sks.k is the first declared klammerset, so `-k sks` loads the SKS by name. The engine's lookup classes were renamed *_set → *_registry to keep the two concepts apart, and the whole C++ tree now follows standard const-correctness conventions. tst/ gains klammerset_test.sh (18 cases). (from dev 64b1abf23e56)
This commit is contained in:
@@ -16,7 +16,7 @@ inline std::map<std::string, int> html_tags {
|
||||
|
||||
using string_pairs_t = std::vector<std::pair<std::string,std::string>>;
|
||||
|
||||
std::string unescape_newlines(std::string s);
|
||||
std::string unescape_newlines(const std::string& s);
|
||||
|
||||
enum class docstruct_t {
|
||||
plain,
|
||||
@@ -24,7 +24,7 @@ enum class docstruct_t {
|
||||
book
|
||||
};
|
||||
|
||||
inline docstruct_t docstruct(std::string name)
|
||||
inline docstruct_t docstruct(const std::string& name)
|
||||
{
|
||||
if (name == "plain") {
|
||||
return docstruct_t::plain;
|
||||
@@ -43,41 +43,41 @@ public:
|
||||
void save_string_input_as_file();
|
||||
|
||||
//void create_directory(std::string directory);
|
||||
void write(std::string filename, std::string contents);
|
||||
void write(const std::string& filename, const std::string& contents);
|
||||
|
||||
/*
|
||||
strings_t get_css_files(
|
||||
std::string output_dir,
|
||||
std::string css_text, strings_t css_files, bool write_file);
|
||||
const std::string& output_dir,
|
||||
const std::string& css_text, const strings_t& css_files, bool write_file);
|
||||
*/
|
||||
|
||||
strings_t get_js_files(
|
||||
bool nav, bool include_sks_js,
|
||||
std::string pages_basenames_filename); // , std::string output_dir, bool write_file);
|
||||
const std::string& pages_basenames_filename); // , const std::string& output_dir, bool write_file);
|
||||
|
||||
argmap m_args {};
|
||||
void write_basenames_js_file(std::string filename, std::vector<std::string> basenames);
|
||||
void write_basenames_js_file(const std::string& filename, const std::vector<std::string>& basenames);
|
||||
std::string create_html_output_directories();
|
||||
std::string create_tex_output_directories();
|
||||
|
||||
std::pair<std::vector<std::string>, std::vector<std::string>>
|
||||
html_auxiliary_files(std::string output_directory, std::string pages_basename_filename,
|
||||
std::vector<std::string> custom_css_files);
|
||||
html_auxiliary_files(const std::string& output_directory, const std::string& pages_basename_filename,
|
||||
const std::vector<std::string>& custom_css_files);
|
||||
|
||||
|
||||
void process_input_files();
|
||||
std::vector<Heading> insert_section_numbers(std::string marker="___NUM___", bool add_to_toc=true);
|
||||
std::vector<Heading> insert_section_numbers(const std::string& marker="___NUM___", bool add_to_toc=true);
|
||||
void insert_html_caption_numbers();
|
||||
std::vector<std::tuple<std::string, std::string, std::string>> reference_list(std::string target_marker);
|
||||
std::vector<std::tuple<std::string, std::string, std::string>> reference_list(const std::string& target_marker);
|
||||
std::map<std::string, std::string> id_to_caption_number();
|
||||
std::map<std::string, std::vector<std::pair<std::string, std::string>>> html_references();
|
||||
void resolve_html_references();
|
||||
std::string single_page_toc();
|
||||
elements_t page(std::string body, std::string output_dir, int max_level);
|
||||
elements_t page(const std::string& body, const std::string& output_dir, int max_level);
|
||||
|
||||
std::string make_single_html_page(std::string output_directory);
|
||||
std::string make_single_html_page(const std::string& output_directory);
|
||||
std::string make_html_navigation_structure(
|
||||
std::string output_directory, std::vector<Heading> headings);
|
||||
const std::string& output_directory, std::vector<Heading> headings);
|
||||
std::string html();
|
||||
std::string tex();
|
||||
std::string make_help_page();
|
||||
@@ -167,13 +167,13 @@ public:
|
||||
std::string m_cache_dir {};
|
||||
};
|
||||
|
||||
fs::path parse_input_filename(std::string s, std::string input_dir);
|
||||
void write_file(std::string filename, std::string contents, bool write_files);
|
||||
fs::path parse_input_filename(const std::string& s, const std::string& input_dir);
|
||||
void write_file(const std::string& filename, const std::string& contents, bool write_files);
|
||||
|
||||
/*
|
||||
std::vector<std::string> combine_files(
|
||||
std::vector<std::string> filenames, std::string output_filename,
|
||||
std::string prolog="", std::string epilog="",
|
||||
const std::vector<std::string>& filenames, const std::string& output_filename,
|
||||
const std::string& prolog="", const std::string& epilog="",
|
||||
bool write_file_p=true,
|
||||
std::function <std::string(std::string)> processor=nullptr);
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user