Files
klammertext/mac/katom_list.h
Andy Kopra d61336b191 Escaping, table layout, and document fixes
Quoted Klammertext specials (^@ ^| ^# ^^ ^: ^*) and ^'...'^ regions now
survive re-processing (held as escape markers until final output);
:after_apply phase functions receive and return raw target text.

Tables: :hpos element position (center|left|right|<length>) replaces the
unimplemented :center/:indent; the ranged cell override is renamed
:justify; :column_width works in html (colgroup widths) and gains
'fill' -- the remaining width, capped at the column's widest entry, in
both targets; a table wider than the text column warns on the console;
table edges without an outer line set their text flush on the margins.

@document: no empty title bar for untitled documents; @vfill fills to
the bottom of the window in html (pure CSS); @vspace in plain text;
new @dot klammer; monospace email links.
2026-07-25 21:16:21 +02:00

54 lines
2.1 KiB
C++

#pragma once
#include "katom.h"
#include "state.h"
std::string to_string(std::vector<Katom>::const_iterator begin, std::vector<Katom>::const_iterator end, bool trim_result=false);
std::string to_string(const std::vector<Katom>& katoms, bool trim_result=false);
// std::vector<Katom> process_katoms(
// const std::string& s, State& state, const std::string& source,
// bool nonascii=true, bool literal=true, bool ignore=true, bool whitespace=true,
// bool klammers=true, bool eval=true, bool cond=true, bool read=true);
bool level_increase(const Katom& k);
bool level_decrease(const Katom& k);
const katom_list::iterator
find_katom_named(const katom_list::iterator begin, const katom_list::iterator end, std::string name);
const std::vector<Katom>::iterator
find_katom(const std::vector<Katom>::iterator begin, const std::vector<Katom>::iterator end, size_t index);
std::vector<std::pair<Katom, Katom>>
find_spans(std::vector<Katom>::iterator begin, std::vector<Katom>::iterator end,
std::function<bool(const Katom&)> level_inc,
std::function<bool(const Katom&)> level_dec,
bool error_exit,
std::string name);
std::vector<std::pair<Katom, Katom>>
find_spans(std::vector<Katom>& katoms,
std::function<bool(const Katom&)> level_inc,
std::function<bool(const Katom&)> level_dec,
bool error_exit=true,
std::string name="all");
void describe_spans(const std::vector<Katom>& katoms);
std::pair<std::vector<Katom>::iterator, std::vector<Katom>::iterator>
find_span_katoms(std::vector<Katom>& katoms, const Katom& begin, const Katom& end);
std::pair<std::vector<Katom>::iterator, std::vector<Katom>::iterator>
find_span_katoms(
std::vector<Katom>::iterator kbegin, std::vector<Katom>::iterator kend, const Katom& begin, const Katom& end);
void encode_nonascii_characters(std::vector<Katom>& katoms);
void mark_literal_katoms(std::vector<Katom>& katoms);
void hide_special_katoms(std::vector<Katom>& katoms);
void mark_ignored_katoms(std::vector<Katom>& katoms);
void process_klammer_katoms(std::vector<Katom>& katoms);