Quick Start with Examples
This page explains the most basic way to create and convert a Base file.
Step 1. Create a Base File
Create a file named foo.base.md
. You can name it whatever you want.
<!---------------------------->
<!-- multilingual suffix: en, fr, ko, ja -->
<!---------------------------->
# Hello, World!
<!-- [en] -->
You can see this written in other languages: `foo.en.md`, `foo.fr.md`, `foo.ja.md`
<!-- [fr] -->
Ceci s'écrit en français comme "Bonjour, le monde !".
<!-- [ko] -->
이것은 한국어로 "안녕, 세상아!"라고 쓴 것입니다.
<!-- [ja] -->
これは日本語で「こんにちは、世のああ!」と書いたものです。
<!-- [common] -->
```md
Thank you for using MMG!
<!-- [en] -->
Tags within code blocks are treated as plain text.
```
Please refer to the "Create a Base File" page for features not introduced here.
Now you are ready to use MMG!
Let's create en
, fr
, ko
, ja
files in the next step.
Step 2. Convert using MMG
Run the following command to perform the conversion.
Check that foo.en.md
, foo.fr.md
, foo.ko.md
, foo.ja.md
files are created in the same path as foo.base.md
.
Cautions
MMG overwrites existing files when creating files. Therefore, you do not need to delete the created files even if you modify the Base file. Instead, any modifications made in the created file will be lost, so please modify contents in the Base file.
mmg foo.base.md
For example, the contents of foo.en.md
are as follows.
# Hello, World!
You can see this written in other languages: `foo.en.md`, `foo.fr.md`, `foo.ja.md`
```md
Thank you for using MMG!
<!-- [en] -->
Tags within code blocks are treated as plain text.
```
Also check foo.fr.md
. You can see that MMG correctly classifies the content according to each tag.
# Hello, World!
Ceci s'écrit en français comme "Bonjour, le monde !".
```md
Thank you for using MMG!
<!-- [en] -->
Tags within code blocks are treated as plain text.
```
How to Convert Multiple Files at Once
MMG has three ways to process multiple files at once.
- (Method 1) Input multiple files as arguments
- (Method 2) Recursively search all subpaths from the current path
- (Method 3) Define tasks in a YAML file and process them in batch
For the first method, you can input multiple files separated by spaces.
mmg Foo.base.md Bar.base.md Baz.base.md
For the second method, use the --recursive
or -r
option, which can also be used with the first method.
Please refer to the recursive option for more information.
Finally, for the third method, please refer to the batch processing with YAML file page.