Chapter 15
Importing and exporting houritsu statutes
houritsu is a repository that converts Japanese statutes from e-Gov Law Search (the Japanese government's statute database) into Markdown and keeps their amendment history as Git versions. ClauseDown can convert statutes in this format into ClauseDown documents and import them. It can also export ClauseDown documents in the same format. This feature is for Japanese statutes.
Importing
When you add a folder containing houritsu-format .md files as a repository, a screen asks whether to convert them. The app recognizes the houritsu format by the information at the top of each document (the section with the statute number and similar details).

Click Convert and save version to convert all documents to the ClauseDown format and save them as one version.
- Article, paragraph and item numbers and text are kept as they were. Places where numbers do not run consecutively from 1 (articles in supplementary provisions, branch numbers such as 第三条の二 (Article 3-2), deleted articles) are kept using the syntax for fixed numbers (chapter 6).
- Chapter headings are kept. Headings for parts, sections, subsections and divisions (編・節・款・目) are removed.
- HTML tables are converted to ClauseDown tables. Merged cells are kept with the
>and^syntax (Merging table cells). - Documents with unsaved changes are not converted.
- The original form remains in the version history.
When the conversion finishes, the app lists documents with points you should check, for example when paragraph numbers were added to old supplementary provisions that had none, or when article numbers do not match the original.

Converted documents can be edited, saved as versions and used in comparison tables like any other document.

Exporting
Turn on Export to Markdown (houritsu) under Experimental features in Developer in Settings, and the item appears in the editor's Export menu. Export → Export as Markdown (houritsu) creates Markdown with article, paragraph and item numbers written into the text. For imported documents, the information at the top (statute number and so on) is restored as it was. Consecutive deleted articles are combined, as in 第三条から第五条まで 削除 ("Articles 3 to 5: Deleted").