From efe7e7730b979ef00e602108deb5dfbfab279f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Urs=20St=C3=B6ckli?= Date: Fri, 12 Jun 2026 15:32:51 +0200 Subject: [PATCH 1/5] Add generation of XML Snippets to toolchain. --- tools/configuration.py | 1 + tools/expand_docs/expand_docs.py | 4 +- tools/toolchain.py | 18 +-- .../build_xml_snippets.cpython-313.pyc | Bin 15963 -> 0 bytes tools/xml_snippets/build_xml_snippets.py | 107 +++++++++++------- 5 files changed, 78 insertions(+), 52 deletions(-) delete mode 100644 tools/xml_snippets/__pycache__/build_xml_snippets.cpython-313.pyc diff --git a/tools/configuration.py b/tools/configuration.py index 9515dd7..ce8d1e5 100644 --- a/tools/configuration.py +++ b/tools/configuration.py @@ -12,5 +12,6 @@ # Generated documents SITE_DIR = PROJECT_DIR.joinpath("../site") SITE_TABLES_DIR = SITE_DIR.joinpath("tables") +SITE_XML_SNIPPETS_DIR = SITE_DIR.joinpath("xml_snippets") diff --git a/tools/expand_docs/expand_docs.py b/tools/expand_docs/expand_docs.py index a93ccc5..7a7955b 100644 --- a/tools/expand_docs/expand_docs.py +++ b/tools/expand_docs/expand_docs.py @@ -68,11 +68,11 @@ def process_markdown_file(input_path, output_path, base_folder): content = f.read() # Process XML snippets - match the entire line prefix and link (flexible text) - xml_pattern = r'(?:- )?\[.*?\]\(\.\./generated/xml-snippets/([^)]+\.xml)\)' + xml_pattern = r'(?:- )?\[.*?\]\(\.\./site/xml-snippets/([^)]+\.xml)\)' content = re.sub(xml_pattern, lambda m: '\n\n' + include_xml_snippet(m, base_folder) + '\n\n', content) # Process markdown tables - match the entire line prefix and link (flexible text) - md_pattern = r'(?:- )?\[.*?\]\(\.\./generated/markdown-examples/([^)]+\.md)\)' + md_pattern = r'(?:- )?\[.*?\]\(\.\./site/tables/([^)]+\.md)\)' content = re.sub(md_pattern, lambda m: '\n\n' + include_markdown_table(m, base_folder) + '\n\n', content) # Write processed content diff --git a/tools/toolchain.py b/tools/toolchain.py index 47e22a9..fa6eb94 100644 --- a/tools/toolchain.py +++ b/tools/toolchain.py @@ -3,9 +3,10 @@ import shutil from pathlib import Path -from tools.configuration import DOCS_DIR, SITE_DIR, XSD_FILE_PATH, SITE_TABLES_DIR, TEMPLATES_DIR, JEKYLL_DIR +from tools.configuration import DOCS_DIR, SITE_DIR, XSD_FILE_PATH, SITE_TABLES_DIR, TEMPLATES_DIR, JEKYLL_DIR, SITE_XML_SNIPPETS_DIR from tools.expand_docs.expand_docs import expand_docs from tools.md_builder.md_builder import build_markdown_tables +from tools.xml_snippets.build_xml_snippets import generate_all_snippets def clean(dir: str): @@ -19,19 +20,22 @@ def copy_jekyll_files(): dst = Path(SITE_DIR) shutil.copytree(src, dst, dirs_exist_ok=True) -def generate_docs(): - expand_docs(DOCS_DIR, SITE_DIR) - # generate_html_files(SITE_DIR) - def generate_tables(): build_markdown_tables(TEMPLATES_DIR, SITE_TABLES_DIR, XSD_FILE_PATH) - # generate_html_files(SITE_TABLES_DIR) + +def generate_xml_snippets(): + generate_all_snippets(TEMPLATES_DIR, SITE_XML_SNIPPETS_DIR) + +def generate_docs(): + expand_docs(DOCS_DIR, SITE_DIR) def main(): clean(SITE_DIR) copy_jekyll_files() - generate_docs() generate_tables() + generate_xml_snippets() + generate_docs() + if __name__ == '__main__': main() diff --git a/tools/xml_snippets/__pycache__/build_xml_snippets.cpython-313.pyc b/tools/xml_snippets/__pycache__/build_xml_snippets.cpython-313.pyc deleted file mode 100644 index 57fc85580f1b74742cddd9679403cab1ef11b58d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15963 zcmc(GYit`wnqc$&Xi}s^N}^s=i+WNo+LC2QvMj}xE%~8`O{!xjvdy8zmQ06gDorYm z8BfMLz#*KSy$hYm!17FRR%RDx8CW39Vu2WY2b?B1xb@;Dw`^16=Ja^80@fI8{`qy6 zyUYQ%Up2d16iq3~?2j#p)!o%!eO2|`YFzlbugOrrw&9fiE z%}+5O#$Y~$PkBP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iqBV2DFk8?f1JC5U4Zhw(vT?KNy(>rS*Np6sqWzD1-KMLG$C)Vc;A=$IE?~ zh)i#}SRFX2a@v`|gaSJtfb7DfHjre;Oc)02u?Md|aQqY6dk^H-ETik7FB6fuRu h{*+cVDm;(J6`0zTh-Xw)zg6r1-RNT#rmhy6{uhhX*4Y36 diff --git a/tools/xml_snippets/build_xml_snippets.py b/tools/xml_snippets/build_xml_snippets.py index 44a6e1f..54680a7 100644 --- a/tools/xml_snippets/build_xml_snippets.py +++ b/tools/xml_snippets/build_xml_snippets.py @@ -21,22 +21,7 @@ from lxml import etree -def parse_args(): - """Parse command line arguments""" - parser = argparse.ArgumentParser( - description='Extract XML snippets from templates with ch-start/ch-stop markers' - ) - parser.add_argument( - '-i', '--input', - required=True, - help='Input folder or single XML file containing templates' - ) - parser.add_argument( - '-o', '--output', - required=True, - help='Output folder for XML snippet files' - ) - return parser.parse_args() + def remove_ch_annotations(text): @@ -357,43 +342,79 @@ def extract_snippet_from_template(file_path): return None -def main(): - args = parse_args() +def generate_all_snippets(input_dir: str, output_dir: str): + """ + Generates all XML snippets from templates in input_dir. - # Create output directory - os.makedirs(args.output, exist_ok=True) + :param input_dir: Input directory + :param output_dir: Output directory where the XML snippets will be generated. + """ - # Determine if input is a file or directory - if os.path.isfile(args.input): - # Single file mode - xml_files = [args.input] - else: - # Directory mode - process all XML files in input directory - xml_files = [os.path.join(args.input, f) for f in os.listdir(args.input) if f.endswith('.xml')] + xml_files = [os.path.join(input_dir, f) for f in os.listdir(input_dir) if f.endswith('.xml')] for file_path in xml_files: - print(f"Processing {os.path.basename(file_path)}") + generate_snippet(file_path, output_dir) + print(f"Processed {len(xml_files)} files") - # Extract snippet - snippet = extract_snippet_from_template(file_path) - if snippet: - # Generate output filename - output_filename = os.path.splitext(os.path.basename(file_path))[0] + '.xml' - output_path = os.path.join(args.output, output_filename) +def generate_snippet(template_path: str, output_dir: str): + """ + Generates a XML snippet from a single template. - # Write to file - with open(output_path, 'w', encoding='utf-8') as f: - # Add XML declaration - f.write('\n') - f.write(snippet) + :param template_path: Path to the template file. + :param output_dir: Output directory where the XML snippet will be generated. + """ + print(f"Processing {os.path.basename(template_path)}") - print(f"Generated {output_path}") - else: - print(f"No snippet extracted from {os.path.basename(file_path)}") + # Extract snippet + snippet = extract_snippet_from_template(template_path) - print(f"Processed {len(xml_files)} files") + if snippet: + + # Create output directory + os.makedirs(output_dir, exist_ok=True) + + # Generate output filename + output_filename = os.path.splitext(os.path.basename(template_path))[0] + '.xml' + output_path = os.path.join(output_dir, output_filename) + # Write to file + with open(output_path, 'w', encoding='utf-8') as f: + # Add XML declaration + f.write('\n') + f.write(snippet) + + print(f"Generated {output_path}") + else: + print(f"No snippet extracted from {os.path.basename(template_path)}") + + +def parse_args(): + """Parse command line arguments""" + parser = argparse.ArgumentParser( + description='Extract XML snippets from templates with ch-start/ch-stop markers' + ) + parser.add_argument( + '-i', '--input', + required=True, + help='Input folder or single XML file containing templates' + ) + parser.add_argument( + '-o', '--output', + required=True, + help='Output folder for XML snippet files' + ) + return parser.parse_args() + +def main(): + args = parse_args() + + # Determine if input is a file or directory + if os.path.isfile(args.input): + generate_snippet(args.input, args.output) + else: + # Directory mode - process all XML files in input directory + generate_all_snippets(args.input, args.output) if __name__ == '__main__': main() From 7e440720c75ca9304351bef69b92c0e00d27def0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Urs=20St=C3=B6ckli?= Date: Fri, 12 Jun 2026 17:43:04 +0200 Subject: [PATCH 2/5] Fix expansion of examples. --- docs/05_frames.md | 8 ++-- docs/06_stops.md | 20 +++++----- docs/07_service.md | 40 +++++++++---------- docs/08_service_calendars.md | 24 +++++------ docs/09_timetable.md | 38 +++++++++--------- docs/10_common.md | 36 ++++++++--------- docs/uc03_transfers.md | 12 +++--- docs/uc13_changes_in_destination.md | 4 +- tools/configuration.py | 2 +- tools/expand_docs/expand_docs.py | 62 ++++++++++++++++++++--------- tools/toolchain.py | 1 - 11 files changed, 136 insertions(+), 111 deletions(-) diff --git a/docs/05_frames.md b/docs/05_frames.md index 245b6f7..c430e57 100644 --- a/docs/05_frames.md +++ b/docs/05_frames.md @@ -15,12 +15,12 @@ In addition to linking to the NeTEx XML schema, this element is used to specify participant's identifier. ### Table -- [Swiss profile tables](../generated/markdown-examples/PublicationDelivery.md) +- [Swiss profile tables](../site/tables/PublicationDelivery.md) *→ [Original NeTEx table](../generated/netex-html/PublicationDelivery.html)* ### Example -- [XML Snippet](../generated/xml-snippets/PublicationDelivery.xml) +- [XML Snippet](../site/xml-snippets/PublicationDelivery.xml) *→ [Template](../templates/PublicationDelivery.xml)* @@ -59,12 +59,12 @@ The `CompositeFrame` is the container for the `FrameDefaults` and the other fram appearing in this order. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/CompositeFrame.md) +- [Swiss profile NeTEx definition](../site/tables/CompositeFrame.md) *→ [General NeTEx definition](../generated/netex-html/CompositeFrame.html)* ### Example -- [Example snippet](../generated/xml-snippets/CompositeFrame.xml) +- [Example snippet](../site/xml-snippets/CompositeFrame.xml) *→ [Template](../templates/CompositeFrame.xml)* diff --git a/docs/06_stops.md b/docs/06_stops.md index 5a2425d..755d9f6 100644 --- a/docs/06_stops.md +++ b/docs/06_stops.md @@ -57,12 +57,12 @@ classDiagram - Not currently modelled: entrances, levels, equipments, paths, accessibility properties, points of interest ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/SiteFrame.md) +- [Swiss profile NeTEx definition](../site/tables/SiteFrame.md) *→ [General NeTEx definition ](../generated/netex-html/SiteFrame.html)* ### Example -- [Example snippet](../generated/xml-snippets/SiteFrame.xml) +- [Example snippet](../site/xml-snippets/SiteFrame.xml) *→ [Template](../templates/SiteFrame.xml)* @@ -78,12 +78,12 @@ Note that a `StopPlace` is a distinct concept from the representation of the sto ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/StopPlace.md) +- [Swiss profile NeTEx definition](../site/tables/StopPlace.md) *→ [General NeTEx definition ](../generated/netex-html/StopPlace.html)* ### Example -- [Example snippet](../generated/xml-snippets/StopPlace.xml) +- [Example snippet](../site/xml-snippets/StopPlace.xml) *→ [Template](../templates/StopPlace.xml)* @@ -102,12 +102,12 @@ A specific boarding or alighting position (platform, stand, bay) within a `StopP ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/StopPlace.md) +- [Swiss profile NeTEx definition](../site/tables/StopPlace.md) *→ [General NeTEx definition ](../generated/netex-html/StopPlace.html)* ### Example -- [Example snippet](../generated/xml-snippets/StopPlace.xml) +- [Example snippet](../site/xml-snippets/StopPlace.xml) *→ [Template](../templates/StopPlace.xml)* @@ -151,13 +151,13 @@ A named geographic area such as a city, municipality, county, or region - used t ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/TopographicPlace.md) +- [Swiss profile NeTEx definition](../site/tables/TopographicPlace.md) *→ [General NeTEx definition ](../generated/netex-html/TopographicPlace.html)* ### Example -- [Example snippet](../generated/xml-snippets/TopographicPlace.xml) +- [Example snippet](../site/xml-snippets/TopographicPlace.xml) *→ [Template](../templates/TopographicPlace.xml)* @@ -171,12 +171,12 @@ The `TopographicPlace` represent the cantons and communes in Switzerland. Each ` It provides precise geographic coordinates (WGS84) of a central reference point representing a single point or an area such as a `Quay`or a `StopPlace`. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/Centroid.md) +- [Swiss profile NeTEx definition](../site/tables/Centroid.md) *→ [General NeTEx definition ](../generated/netex-html/Centroid.html)* ### Example -- [Example snippet](../generated/xml-snippets/Centroid.xml) +- [Example snippet](../site/xml-snippets/Centroid.xml) *→ [Template](../templates/Centroid.xml)* diff --git a/docs/07_service.md b/docs/07_service.md index 3cb0eb9..dd740e1 100644 --- a/docs/07_service.md +++ b/docs/07_service.md @@ -98,12 +98,12 @@ Other important classes of the `ServiceFrame` include: - `Notice`s which are then assigned to `Journey` and `Passingtime` of the `TimetableFrame` through `NoticeAssignment`s. They model the association of footnotes and passenger information content such as stop announcements and the network. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ServiceFrame.md) +- [Swiss profile NeTEx definition](../site/tables/ServiceFrame.md) *→ [General NeTEx definition ](../generated/netex-html/ServiceFrame.html)* ### Example -- [Example snippet](../generated/xml-snippets/ServiceFrame.xml) +- [Example snippet](../site/xml-snippets/ServiceFrame.xml) *→ [Template](../templates/ServiceFrame.xml)* @@ -123,13 +123,13 @@ This means that the old two defined dirctions `ch:1:Direction:H` and `ch:1:Direc A public transport service line, representing a marketed route with a `Name`, `TransportMode`, and `Operator`. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/Line.md) +- [Swiss profile NeTEx definition](../site/tables/Line.md) *-> [General NeTEx definition](../generated/netex-html/Line.html)* ### Example -- [Example snippet](../generated/xml-snippets/Line.xml) +- [Example snippet](../site/xml-snippets/Line.xml) *->[Template](../templates/Line.xml)* @@ -150,13 +150,13 @@ A public transport service line, representing a marketed route with a `Name`, `T Showing the destination of a `ServiceJourney`. The text shown on the front or side of a public transport vehicle to indicate its destination, including via-points and variant labels. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/DestinationDisplay.md) +- [Swiss profile NeTEx definition](../site/tables/DestinationDisplay.md) *-> [General NeTEx definition](../generated/netex-html/DestinationDisplay.html)* ### Example -- [Example snippet](../generated/xml-snippets/DestinationDisplay.xml) +- [Example snippet](../site/xml-snippets/DestinationDisplay.xml) *->[Template](../templates/DestinationDisplay.xml)* @@ -179,13 +179,13 @@ A `ScheduledStopPoint` can represent two types of stop points: ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ScheduledStopPoint.md) +- [Swiss profile NeTEx definition](../site/tables/ScheduledStopPoint.md) *-> [General NeTEx definition](../generated/netex-html/ScheduledStopPoint.html)* ### Example -- [Example snippet](../generated/xml-snippets/ScheduledStopPoint.xml) +- [Example snippet](../site/xml-snippets/ScheduledStopPoint.xml) *->[Template](../templates/ScheduledStopPoint.xml)* @@ -199,13 +199,13 @@ A `ScheduledStopPoint` can represent two types of stop points: - A `ScheduledStopPoint` in a `ServiceJourneyPattern` is linked to a `Quay` for arrival and departure. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/PassengerStopAssignment.md) +- [Swiss profile NeTEx definition](../site/tables/PassengerStopAssignment.md) *-> [General NeTEx definition](../generated/netex-html/PassengerStopAssignment.html)* ### Example -- [Example snippet](../generated/xml-snippets/PassengerStopAssignment.xml) +- [Example snippet](../site/xml-snippets/PassengerStopAssignment.xml) *->[Template](../templates/PassengerStopAssignment.xml)* @@ -226,13 +226,13 @@ A `ScheduledStopPoint` can represent two types of stop points: ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/DefaultConnection.md) +- [Swiss profile NeTEx definition](../site/tables/DefaultConnection.md) *-> [General NeTEx definition](../generated/netex-html/DefaultConnection.html)* ### Example -- [Example snippet](../generated/xml-snippets/DefaultConnection.xml) +- [Example snippet](../site/xml-snippets/DefaultConnection.xml) *->[Template](../templates/DefaultConnection.xml)* @@ -248,13 +248,13 @@ The `SiteConnection` describes the transfer times between two adjacent `StopPlac ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/SiteConnection.md) +- [Swiss profile NeTEx definition](../site/tables/SiteConnection.md) *-> [General NeTEx definition](../generated/netex-html/SiteConnection.html)* ### Example -- [Example snippet](../generated/xml-snippets/SiteConnection.xml) +- [Example snippet](../site/xml-snippets/SiteConnection.xml) *->[Template](../templates/SiteConnection.xml)* @@ -271,13 +271,13 @@ For more details see the [use case on transfers](uc03_transfers.md). ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ServiceJourneyPattern.md) +- [Swiss profile NeTEx definition](../site/tables/ServiceJourneyPattern.md) *-> [General NeTEx definition](../generated/netex-html/ServiceJourneyPattern.html)* ### Example -- [Example snippet](../generated/xml-snippets/ServiceJourneyPattern.xml) +- [Example snippet](../site/xml-snippets/ServiceJourneyPattern.xml) *->[Template](../templates/ServiceJourneyPattern)* @@ -293,13 +293,13 @@ Informational or regulatory text associated with public transport services, disp ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/Notice.md) +- [Swiss profile NeTEx definition](../site/tables/Notice.md) *-> [General NeTEx definition](../generated/netex-html/Notice.html)* ### Example -- [Example snippet](../generated/xml-snippets/Notice.xml) +- [Example snippet](../site/xml-snippets/Notice.xml) *->[Template](../templates/Notice.xml)* @@ -314,12 +314,12 @@ Informational or regulatory text associated with public transport services, disp Assign a `Notice` to an element. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/NoticeAssignment.md) +- [Swiss profile NeTEx definition](../site/tables/NoticeAssignment.md) *-> [General NeTEx definition](../generated/netex-html/NoticeAssignment.html)* ### Example -- [Example snippet](../generated/xml-snippets/NoticeAssignment.xml) +- [Example snippet](../site/xml-snippets/NoticeAssignment.xml) *->[Template](../templates/NoticeAssignment.xml)* diff --git a/docs/08_service_calendars.md b/docs/08_service_calendars.md index 0616375..6bf49d2 100644 --- a/docs/08_service_calendars.md +++ b/docs/08_service_calendars.md @@ -88,12 +88,12 @@ classDiagram ``` #### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ServiceCalendarFrame.md) +- [Swiss profile NeTEx definition](../site/tables/ServiceCalendarFrame.md) *→ [General NeTEx definition](../generated/netex-html/ServiceCalendarFrame.html)* #### Example -- [Example snippet](../generated/xml-snippets/ServiceCalendarFrame.xml) +- [Example snippet](../site/xml-snippets/ServiceCalendarFrame.xml) *→ [Template](../templates/ServiceCalendarFrame.xml)* @@ -107,12 +107,12 @@ classDiagram Temporal availability in terms of `Date`s, `Timeband`s, `ValidDayBits`. #### Table --[Swiss profile NeTEx definition](../generated/markdown-examples/AvailabilityCondition.md) +-[Swiss profile NeTEx definition](../site/tables/AvailabilityCondition.md) *→ [General NeTEx definition](../generated/netex-html/AvailabilityCondition.html)* #### Example -- [Example snippet](../generated/xml-snippets/AvailabilityCondition.xml) +- [Example snippet](../site/xml-snippets/AvailabilityCondition.xml) *→ [Template](../templates/AvailabilityCondition.xml)* @@ -137,12 +137,12 @@ Temporal availability in terms of `Date`s, `Timeband`s, `ValidDayBits`. Long-term planning uses calendar days that are classified as specific DayTypes (example: weekday in school holidays). A ServiceCalendar defines a mapping between DayTypes and OperatingDays. #### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ServiceCalendar.md) +- [Swiss profile NeTEx definition](../site/tables/ServiceCalendar.md) *→ [General NeTEx definition](../generated/netex-html/ServiceCalendar.html)* #### Example -- [Example snippet](../generated/xml-snippets/ServiceCalendar.xml) +- [Example snippet](../site/xml-snippets/ServiceCalendar.xml) *→ [Template](../templates/ServiceCalendar.xml)* @@ -155,12 +155,12 @@ A classification of days on which a specific set of transport services operates #### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/DayType.md) +- [Swiss profile NeTEx definition](../site/tables/DayType.md) *→ [General NeTEx definition](../generated/netex-html/DayType.html)* #### Example -- [Example snippet](../generated/xml-snippets/DayType.xml) +- [Example snippet](../site/xml-snippets/DayType.xml) *→ [Template](../templates/DayType.xml)* @@ -173,12 +173,12 @@ A period of time within a day, usually defined by a start and end time. #### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/Timeband.md) +- [Swiss profile NeTEx definition](../site/tables/Timeband.md) *→ [General NeTEx definition](../generated/netex-html/Timeband.html)* #### Example -- [Example snippet](../generated/xml-snippets/Timeband.xml) +- [Example snippet](../site/xml-snippets/Timeband.xml) *→ [Template](../templates/Timeband.xml)* @@ -197,12 +197,12 @@ This assignment overrides the `DayType` specified for the day in the overall pla #### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/DayTypeAssignment.md) +- [Swiss profile NeTEx definition](../site/tables/DayTypeAssignment.md) *→ [General NeTEx definition](../generated/netex-html/DayTypeAssignment.html)* #### Example -[Example snippet](../generated/xml-snippets/DayTypeAssignment.xml) +[Example snippet](../site/xml-snippets/DayTypeAssignment.xml) *→ [Template](../templates/DayTypeAssignment.xml)* diff --git a/docs/09_timetable.md b/docs/09_timetable.md index ca4211c..f490735 100644 --- a/docs/09_timetable.md +++ b/docs/09_timetable.md @@ -39,12 +39,12 @@ A `TimetableFrame` contains the operational journey definitions — the actual t ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/TimetableFrame.md) +- [Swiss profile NeTEx definition](../site/tables/TimetableFrame.md) *→ [General NeTEx definition ](../generated/netex-html/TimetableFrame.html)* ### Example -- [Example snippet](../generated/xml-snippets/TimetableFrame.xml) +- [Example snippet](../site/xml-snippets/TimetableFrame.xml) *→ [Template](../templates/TimetableFrame.xml)* @@ -58,12 +58,12 @@ A `TimetableFrame` contains the operational journey definitions — the actual t A `ServiceJourney` represents a planned trip in the timetable operating on a recurring schedule. It defines the stop sequence via reference to a `JourneyPattern`, includes scheduled passing times, and specifies operational details such as operator and days of operation. Unlike `DatedServiceJourney`, which represents a concrete instance on a specific date, `ServiceJourney` is the reusable template used across multiple dates via `DayType` definitions ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ServiceJourney.md) +- [Swiss profile NeTEx definition](../site/tables/ServiceJourney.md) *→ [General NeTEx definition ](../generated/netex-html/ServiceJourney.html)* ### Example -- [Example snippet](../generated/xml-snippets/ServiceJourney.xml) +- [Example snippet](../site/xml-snippets/ServiceJourney.xml) *→ [Template](../templates/ServiceJourney.xml)* @@ -84,12 +84,12 @@ A `TemplateServiceJourney` represents a sequence of planned trips. It is similar A frequency is specified in a `HeadwayJourneyGroup` (e.g. every 20 minutes). The `TemplateServiceJourney` may thus represent multiple journeys or it could be used simply as a template for adding extra date journeys after the planning phase. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/TemplateServiceJourney.md) +- [Swiss profile NeTEx definition](../site/tables/TemplateServiceJourney.md) *→ [General NeTEx definition ](../generated/netex-html/TemplateServiceJourney.html)* ### Example -- [Example snippet](../generated/xml-snippets/TemplateServiceJourney.xml) +- [Example snippet](../site/xml-snippets/TemplateServiceJourney.xml) *→ [Template](../templates/TemplateServiceJourney.xml)* @@ -106,12 +106,12 @@ A frequency is specified in a `HeadwayJourneyGroup` (e.g. every 20 minutes). The `OccupancyView`can be used on the `Journey`, `JourneyPart`, and `TimetabledPassingTime` elements. Used for predicted and planned occupancies of vehicles. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/OccupancyView.md) +- [Swiss profile NeTEx definition](../site/tables/OccupancyView.md) *→ [General NeTEx definition ](../generated/netex-html/OccupancyView.html)* ### Example -- [Example snippet](../generated/xml-snippets/OccupancyView.xml) +- [Example snippet](../site/xml-snippets/OccupancyView.xml) *→ [Template](../templates/OccupancyView.xml)* @@ -126,12 +126,12 @@ We currently don't use OccupancyView. Codes assigned to particular journeys (`ServiceJourney`, `TemplateServiceJourney`) when operated by trains. `ServiceJourney`s can in principle have multiple different `TrainNumber`s whereas a `JourneyPart` can only reference a single one. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/TrainNumber.md) +- [Swiss profile NeTEx definition](../site/tables/TrainNumber.md) *→ [General NeTEx definition ](../generated/netex-html/TrainNumber.html)* ### Example -- [Example snippet](../generated/xml-snippets/TrainNumber.xml) +- [Example snippet](../site/xml-snippets/TrainNumber.xml) *→ [Template](../templates/TrainNumber.xml)* @@ -142,12 +142,12 @@ Codes assigned to particular journeys (`ServiceJourney`, `TemplateServiceJourney `TypeOfService` indicates the purpose of a `ServiceJourney`, for example, whether if it is a passenger transport or a garage run-in. We only use `ch:1:TypeOfService:1` ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/TypeOfService.md) +- [Swiss profile NeTEx definition](../site/tables/TypeOfService.md) *→ [General NeTEx definition](../generated/netex-html/TypeOfService.html)* ### Example -- [XML Snippet](../generated/xml-snippets/TypeOfService.xml) +- [XML Snippet](../site/xml-snippets/TypeOfService.xml) *→ - [Template](../templates/TypeOfService.xml)* @@ -172,12 +172,12 @@ Actually there is only one allowed value that we use in the Swiss profile: Only Long-term planned time data concerning public transport vehicles passing a particular `PointInJourneyPattern` on a specified vehicle journey for a certain `DayType`. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/TimetabledPassingTime.md) +- [Swiss profile NeTEx definition](../site/tables/TimetabledPassingTime.md) *→ [General NeTEx definition ](../generated/netex-html/TimetabledPassingTime.html)* ### Example -- [Example snippet](../generated/xml-snippets/TimetabledPassingTime.xml) +- [Example snippet](../site/xml-snippets/TimetabledPassingTime.xml) *→ [Template](../templates/TimetabledPassingTime.xml)* @@ -199,7 +199,7 @@ Long-term planned time data concerning public transport vehicles passing a parti An `InterchangeRule`defines the possibility of interchanging between two `ServiceJourney`s at the same or different `ScheduledStopPoint*` — where at least one journey is specified indirectly via `Direction`, `Line` or the VEHICLE JOURNEY (? **TODO**), rather than as an explicit journey pair. The rule specifies criteria (e.g. `Mode`, `Line`, `Direction`) that a candidate feeder or distributor journey must fulfil. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/InterchangeRule.md) +- [Swiss profile NeTEx definition](../site/tables/InterchangeRule.md) *→ [General NeTEx definition ](../generated/netex-html/InterchangeRule.html)* @@ -207,10 +207,10 @@ An `InterchangeRule`defines the possibility of interchanging between two `Servic ### Examples #### Interchanges between ServiceJourneys -- [Example snippet](../generated/xml-snippets/InterchangeRule_UMSTEIGZ.xml) +- [Example snippet](../site/xml-snippets/InterchangeRule_UMSTEIGZ.xml) #### Interchange between Lines/Directions/Operators -- [Example snippet](../generated/xml-snippets/InterchangeRule_UMSTEIGL.xml) +- [Example snippet](../site/xml-snippets/InterchangeRule_UMSTEIGL.xml) ### Usage Notes @@ -237,12 +237,12 @@ An `InterchangeRule`defines the possibility of interchanging between two `Servic [//]: # (**TODO**: Add JourneyMeeting links) ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/JourneyMeeting.md) +- [Swiss profile NeTEx definition](../site/tables/JourneyMeeting.md) *→ [General NeTEx definition ](../generated/netex-html/JourneyMeeting.html)* ### Example -- [Example snippet](../generated/xml-snippets/JourneyMeeting.xml) +- [Example snippet](../site/xml-snippets/JourneyMeeting.xml) *→ [Template](../templates/JourneyMeeting.xml))* diff --git a/docs/10_common.md b/docs/10_common.md index 95fad31..4df25b0 100644 --- a/docs/10_common.md +++ b/docs/10_common.md @@ -82,13 +82,13 @@ If a `ServiceJourney` (in a particular `Call`) runs over midnight, then `DayOffs Holds default values for certain basic parameters. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/FrameDefaults.md) +- [Swiss profile NeTEx definition](../site/tables/FrameDefaults.md) *→ [General NeTEx definition](../generated/netex-html/FrameDefaults.html)* ### Example -- [XML Snippet](../generated/xml-snippets/FrameDefaults.xml) +- [XML Snippet](../site/xml-snippets/FrameDefaults.xml) *→ [Template](../templates/FrameDefaults.xml)* @@ -107,12 +107,12 @@ a `StopPlace` or `Organisation`. For all other alternative texts use `AlternativeText`. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/AlternativeName.md) +- [Swiss profile NeTEx definition](../site/tables/AlternativeName.md) *→ - [General NeTEx definition](../generated/netex-html/AlternativeName.html)* ### Example -- [XML Snippet](../generated/xml-snippets/AlternativeName.xml) +- [XML Snippet](../site/xml-snippets/AlternativeName.xml) *→ - [Template](../templates/AlternativeName.xml)* @@ -132,12 +132,12 @@ The `AlternativeText` is a generic way to provide an alternative text (translati For example, it can be used for the translation of `Notice` texts. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/AlternativeText.md) +- [Swiss profile NeTEx definition](../site/tables/AlternativeText.md) *→ - [General NeTEx definition](../generated/netex-html/AlternativeText.html)* ### Example -- [XML Snippet](../generated/xml-snippets/AlternativeText.xml) +- [XML Snippet](../site/xml-snippets/AlternativeText.xml) *→ - [Template](../templates/AlternativeText.xml)* @@ -175,12 +175,12 @@ See the following class diagram for the most important objects of the RESOURCE F - SiteFacilitySet ## Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ResourceFrame.md) +- [Swiss profile NeTEx definition](../site/tables/ResourceFrame.md) *→ - [General NeTEx definition](../generated/netex-html/ResourceFrame.html)* ## Example -- [XML Snippet](../generated/xml-snippets/ResourceFrame.xml) +- [XML Snippet](../site/xml-snippets/ResourceFrame.xml) *→ - [Template](../templates/ResourceFrame.xml)* @@ -203,12 +203,12 @@ We use this element to describe the different roles of the participating compan | `EntityLegalOwnership` | Role of the **concession company** holding the concession for the original service | | `Operation` | role of the **operator company** responsible for providing the transport service | ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ResponsibilitySet.md) +- [Swiss profile NeTEx definition](../site/tables/ResponsibilitySet.md) *→ - [General NeTEx definition](../generated/netex-html/ResponsibilitySet.html)* ### Example -- [XML Snippet](../generated/xml-snippets/ResponsibilitySet.xml) +- [XML Snippet](../site/xml-snippets/ResponsibilitySet.xml) *→ - [Template](../templates/ResponsibilitySet.xml)* @@ -290,13 +290,13 @@ For the ServiceJourneys exclusively provided in Switzerland, only the ProductCat For ServiceJourneys provided in other countries or partially in Switzerland, there are no restrictions, provided that the category does not overlap with the ProductCategories defined for Switzerland. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/TypeOfProductCategory.md) +- [Swiss profile NeTEx definition](../site/tables/TypeOfProductCategory.md) *→ [General NeTEx definition](../generated/netex-html/TypeOfProductCategory.html)* ### Example -- [XML Snippet](../generated/xml-snippets/TypeOfProductCategory.xml) +- [XML Snippet](../site/xml-snippets/TypeOfProductCategory.xml) *→ [Template](../templates/TypeOfProductCategory.xml)* @@ -314,12 +314,12 @@ Organisations located in Switzerland are identified by their [GO-number](https:/ in Switzerland. The TU-Code is to be used for operators of other countries. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/Operator.md) +- [Swiss profile NeTEx definition](../site/tables/Operator.md) *→ [General NeTEx definition](../generated/netex-html/Operator.html)* ### Example -- [XML Snippet](../generated/xml-snippets/Operator.xml) +- [XML Snippet](../site/xml-snippets/Operator.xml) *→ - [Template](../templates/Operator.xml)* @@ -356,12 +356,12 @@ Set of `Facilitiy`s available for a `ServiceJourney` or a `JourneyPart`. > **TODO** a lot more detail needed. But probably in uc ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/ServiceFacilitySet.md) +- [Swiss profile NeTEx definition](../site/tables/ServiceFacilitySet.md) *→ [General NeTEx definition](../generated/netex-html/ServiceFacilitySet.html)* ### Example -- [XML Snippet](../generated/xml-snippets/ServiceFacilitySet.xml) +- [XML Snippet](../site/xml-snippets/ServiceFacilitySet.xml) *→ - [Template](../templates/ServiceFacilitySet.xml)* @@ -402,12 +402,12 @@ A `SiteFacilitySet` defines a set of facilities like sanitary facilities, ticket referenced to define facilities of a site. ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/SiteFacilitySet.md) +- [Swiss profile NeTEx definition](../site/tables/SiteFacilitySet.md) *→ [General NeTEx definition](../generated/netex-html/SiteFacilitySet.html)* ### Example -- [XML Snippet](../generated/xml-snippets/SiteFacilitySet.xml) +- [XML Snippet](../site/xml-snippets/SiteFacilitySet.xml) *→ - [Template](../templates/SiteFacilitySet.xml)* diff --git a/docs/uc03_transfers.md b/docs/uc03_transfers.md index d399c64..387d9f1 100644 --- a/docs/uc03_transfers.md +++ b/docs/uc03_transfers.md @@ -17,25 +17,25 @@ The following table shows how we will map HRDF tables into NeTEX. **TODO** details from Powerpoint to be included ## General transfer time between modes -- [Example](../generated/xml-snippets/DefaultConnection_Modes.xml) +- [Example](../site/xml-snippets/DefaultConnection_Modes.xml) ## Transfer times at a given StopPlace **TODO** details from Powerpoint to be included -- [Example](../generated/xml-snippets/DefaultConnection_UMSTEIGB.xml) +- [Example](../site/xml-snippets/DefaultConnection_UMSTEIGB.xml) ## Operator related transfer times **TODO** details from Powerpoint to be included -- [Example](../generated/xml-snippets/DefaultConnection_UMSTEIGV.xml) +- [Example](../site/xml-snippets/DefaultConnection_UMSTEIGV.xml) ## Line and Direction-oriented transfer times **TODO** details from Powerpoint to be included -- [Example](../generated/xml-snippets/InterchangeRule_UMSTEIGL.xml) +- [Example](../site/xml-snippets/InterchangeRule_UMSTEIGL.xml) ## ServiceJourney related transfer times @@ -51,7 +51,7 @@ The following situations exist: The differences between the various situations are to be differentiated with the value in some attributes. **TODO** copy stuff from 10.2 -- [Example](../generated/xml-snippets/InterchangeRule_UMSTEIGZ.xml) +- [Example](../site/xml-snippets/InterchangeRule_UMSTEIGZ.xml) ## Transfer times between StopPlaces @@ -59,4 +59,4 @@ The differences between the various situations are to be differentiated with the The differences between the various situations are to be differentiated with the value in some attributes. -- [Example](../generated/xml-snippets/SiteConnection.xml) +- [Example](../site/xml-snippets/SiteConnection.xml) diff --git a/docs/uc13_changes_in_destination.md b/docs/uc13_changes_in_destination.md index 1caa0be..abf6398 100644 --- a/docs/uc13_changes_in_destination.md +++ b/docs/uc13_changes_in_destination.md @@ -4,12 +4,12 @@ ### Table -- [Swiss profile NeTEx definition](../generated/markdown-examples/DestinationDisplayChange.md) +- [Swiss profile NeTEx definition](../site/tables/DestinationDisplayChange.md) *-> [General NeTEx definition](../generated/netex-html/DestinationDisplay.html)* ### Example -- [Example snippet](../generated/xml-snippets/DestinationDisplayChange.xml) +- [Example snippet](../site/xml-snippets/DestinationDisplayChange.xml) *->[Template](../templates/DestinationDisplayChange.xml)* \ No newline at end of file diff --git a/tools/configuration.py b/tools/configuration.py index ce8d1e5..266b1ce 100644 --- a/tools/configuration.py +++ b/tools/configuration.py @@ -12,6 +12,6 @@ # Generated documents SITE_DIR = PROJECT_DIR.joinpath("../site") SITE_TABLES_DIR = SITE_DIR.joinpath("tables") -SITE_XML_SNIPPETS_DIR = SITE_DIR.joinpath("xml_snippets") +SITE_XML_SNIPPETS_DIR = SITE_DIR.joinpath("xml-snippets") diff --git a/tools/expand_docs/expand_docs.py b/tools/expand_docs/expand_docs.py index 7a7955b..1d10bf0 100644 --- a/tools/expand_docs/expand_docs.py +++ b/tools/expand_docs/expand_docs.py @@ -6,7 +6,7 @@ import shutil import argparse import re -from tools.configuration import DOCS_DIR, SITE_DIR +from tools.configuration import DOCS_DIR, SITE_DIR, SITE_TABLES_DIR, SITE_XML_SNIPPETS_DIR TABLE_MD_LINK_TARGET_PATTERN = re.compile(r'(\[.*])\((.*(\.)md).*\)') TABLE_MD_LINK_TARGET_REPLACEMENT = r'\1(./tables/\2)' @@ -20,28 +20,38 @@ def copy_media_folder(input_folder, output_folder): shutil.copytree(media_src, media_dst, dirs_exist_ok=True) -def include_xml_snippet(match, base_folder): - """Include XML snippet content directly.""" - snippet_path = match.group(1) +def include_xml_snippet(snippet_file_name: str, base_folder: str): + """ + Include XML snippet content directly. + + param: snippet_file_name: Snippet file name + param: base_folder: Path to the documents base folder + + """ # Look for files in the main generated folder, not output folder # The generated folder is at the root of the project # base_folder is already the docs folder, so go up one level to project root project_root = os.path.abspath(os.path.join(base_folder, '..')) - full_path = os.path.join(project_root, 'generated', 'xml-snippets', snippet_path) + full_path = os.path.join(project_root, 'site', 'xml-snippets', snippet_file_name) if os.path.exists(full_path): with open(full_path, 'r', encoding='utf-8') as f: return f"```xml\n{f.read()}\n```" - return match.group(0) + return snippet_file_name + +def include_markdown_table(table_file_name: str, base_folder: str): + """ + Include markdown table content directly. + + param: table_file_name: Path to the markdown table file + param: base_folder: Path to the documents base folder + """ -def include_markdown_table(match, base_folder): - """Include markdown table content directly.""" - table_path = match.group(1) # Look for files in the main generated folder, not output folder # The generated folder is at the root of the project # base_folder is already the docs folder, so go up one level to project root project_root = os.path.abspath(os.path.join(base_folder, '..')) - full_path = os.path.join(project_root, 'generated', 'markdown-examples', table_path) + full_path = os.path.join(project_root, 'site', 'tables', table_file_name) if os.path.exists(full_path): with open(full_path, 'r', encoding='utf-8') as f: @@ -59,27 +69,43 @@ def include_markdown_table(match, base_folder): elif in_table: break return '\n'.join(table_lines) - return match.group(0) + return table_file_name -def process_markdown_file(input_path, output_path, base_folder): - """Process a single markdown file.""" - with open(input_path, 'r', encoding='utf-8') as f: +def expand_markdown_file(input_file_path, output_file_path, base_folder): + """ + Expands a single markdown file: integrates/expands xml snippets and markdown tables. + + param: input_file_path: Path to the input markdown file + param: output_file_path: Path to the output markdown file + param: base_folder: Path to the documents base folder + """ + with open(input_file_path, 'r', encoding='utf-8') as f: content = f.read() # Process XML snippets - match the entire line prefix and link (flexible text) xml_pattern = r'(?:- )?\[.*?\]\(\.\./site/xml-snippets/([^)]+\.xml)\)' - content = re.sub(xml_pattern, lambda m: '\n\n' + include_xml_snippet(m, base_folder) + '\n\n', content) + content = re.sub(xml_pattern, lambda m: '\n\n' + include_xml_snippet(m.group(1), base_folder) + '\n\n', content) # Process markdown tables - match the entire line prefix and link (flexible text) md_pattern = r'(?:- )?\[.*?\]\(\.\./site/tables/([^)]+\.md)\)' - content = re.sub(md_pattern, lambda m: '\n\n' + include_markdown_table(m, base_folder) + '\n\n', content) + content = re.sub(md_pattern, lambda m: '\n\n' + include_markdown_table(m.group(1), base_folder) + '\n\n', content) # Write processed content - with open(output_path, 'w', encoding='utf-8') as f: + with open(output_file_path, 'w', encoding='utf-8') as f: f.write(content) + def expand_docs(input_dir: str, output_dir: str): + """ + Expands all markdown files in input_dir: integrates/expands xml snippets and markdown tables. + + param: input_file_path: Path to the input dir to search for input markdown files + param: output_file_path: Path to the output dir + param: xml_snippets_path: Path to the folder to look for xml snippets + param: table_path: Path to the folder to look for markdown tables + """ + # Create output folder if it doesn't exist os.makedirs(output_dir, exist_ok=True) @@ -91,7 +117,7 @@ def expand_docs(input_dir: str, output_dir: str): if filename.endswith('.md'): input_md = os.path.join(input_dir, filename) output_md = os.path.join(output_dir, filename) - process_markdown_file(input_md, output_md, input_dir) + expand_markdown_file(input_md, output_md, input_dir) print(f"Documentation expanded successfully to {output_dir}") diff --git a/tools/toolchain.py b/tools/toolchain.py index fa6eb94..d17147d 100644 --- a/tools/toolchain.py +++ b/tools/toolchain.py @@ -36,6 +36,5 @@ def main(): generate_xml_snippets() generate_docs() - if __name__ == '__main__': main() From 160369c77cb935a52d52f6388d1c682d858294bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Urs=20St=C3=B6ckli?= Date: Fri, 19 Jun 2026 08:39:37 +0200 Subject: [PATCH 3/5] GitHub pages: Add footer.html to in include mermaid script. --- jekyll/_includes/footer.html | 39 +++++++++++++++++++++++++++++++++++ jekyll/_includes/mermaid.html | 10 +++++++++ 2 files changed, 49 insertions(+) create mode 100644 jekyll/_includes/footer.html create mode 100644 jekyll/_includes/mermaid.html diff --git a/jekyll/_includes/footer.html b/jekyll/_includes/footer.html new file mode 100644 index 0000000..498753e --- /dev/null +++ b/jekyll/_includes/footer.html @@ -0,0 +1,39 @@ +
+ + +
+ + + + + +
+ +
+ +{%- if page.mermaid -%} + {%- include mermaid.html -%} +{%- endif -%} diff --git a/jekyll/_includes/mermaid.html b/jekyll/_includes/mermaid.html new file mode 100644 index 0000000..905a109 --- /dev/null +++ b/jekyll/_includes/mermaid.html @@ -0,0 +1,10 @@ + + \ No newline at end of file From 99d5a721b6b5ffe3c4ffed8935e692eea37c4800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Urs=20St=C3=B6ckli?= Date: Fri, 19 Jun 2026 08:42:24 +0200 Subject: [PATCH 4/5] GitHub pages: Enable mairmaid. --- docs/02_basic_concepts.md | 3 +++ jekyll/_includes/mermaid.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/02_basic_concepts.md b/docs/02_basic_concepts.md index cbdc027..876b84f 100644 --- a/docs/02_basic_concepts.md +++ b/docs/02_basic_concepts.md @@ -1,3 +1,6 @@ +--- +mermaid: true +--- # Basic concepts in NeTEx NeTEx can support multiple use cases. Here we talk about the Swiss timetable delivery. diff --git a/jekyll/_includes/mermaid.html b/jekyll/_includes/mermaid.html index 905a109..00e08d9 100644 --- a/jekyll/_includes/mermaid.html +++ b/jekyll/_includes/mermaid.html @@ -1,4 +1,4 @@ - +