From 7dfa9056250b4368d4a4e6148da05557d00d48fc Mon Sep 17 00:00:00 2001 From: "Luiz \"darknessxk\" Felipe" Date: Thu, 6 May 2021 19:21:02 -0300 Subject: [PATCH] Changed the examples pattern to a better one with indexation, better ordered menus --- docs/building.markdown | 1 + docs/examples.markdown | 63 ----------------------- docs/examples/cpp-version-change.markdown | 17 ++++++ docs/examples/import-from-folder.markdown | 20 +++++++ docs/examples/import-from-git.markdown | 22 ++++++++ docs/examples/index.markdown | 10 ++++ docs/examples/quickstart.markdown | 23 +++++++++ docs/usage.markdown | 1 + 8 files changed, 94 insertions(+), 63 deletions(-) delete mode 100644 docs/examples.markdown create mode 100644 docs/examples/cpp-version-change.markdown create mode 100644 docs/examples/import-from-folder.markdown create mode 100644 docs/examples/import-from-git.markdown create mode 100644 docs/examples/index.markdown create mode 100644 docs/examples/quickstart.markdown diff --git a/docs/building.markdown b/docs/building.markdown index 313f53b..634c873 100644 --- a/docs/building.markdown +++ b/docs/building.markdown @@ -2,6 +2,7 @@ layout: page title: Building permalink: /building/ +nav_order: 1 --- # Building diff --git a/docs/examples.markdown b/docs/examples.markdown deleted file mode 100644 index 3f6e9e3..0000000 --- a/docs/examples.markdown +++ /dev/null @@ -1,63 +0,0 @@ ---- -layout: page -title: Examples -permalink: /examples/ ---- - -# Examples - -## Quickstart - -Smallest possible start point you can have using cmkr - -```toml -[cmake] -version = "3.15" - -[project] -name = "hello-world" - -[target.hello-world] -type = "executable" -sources = [ "src/*.cpp" ] -``` - -## Changing C++/C version - -Simple example changing C++ to version 20 and C standard to the version 11 - -```toml -[target.example] -type = "executable" -compile-features = [ "cxx_std_20", "c_std_11" ] -``` - -## Import from another Git repository - -Importing an existing project called Zydis to my project - -tag is optional but you can target any branch with it - -```toml -[fetch-content] -zydis = { git = "https://github.com/zyantific/zydis.git", tag = "v3.1.0" } - -[target.example] -type = "executable" -link-libraries = ["zydis"] -``` - -## Import from another folder - -Importing an existing project called Zydis to my project - -tag is optional but you can target any branch with it - -```toml -[fetch-content] -zydis = { git = "https://github.com/zyantific/zydis.git", tag = "v3.1.0" } - -[target.example] -type = "executable" -link-libraries = ["zydis"] -``` diff --git a/docs/examples/cpp-version-change.markdown b/docs/examples/cpp-version-change.markdown new file mode 100644 index 0000000..d2eeed5 --- /dev/null +++ b/docs/examples/cpp-version-change.markdown @@ -0,0 +1,17 @@ +--- +layout: page +title: Changing C/C++ version +permalink: /examples/quickstart +parent: Examples +nav_order: 1 +--- + +# Changing C/C++ version + +Simple example changing C++ to version 20 and C standard to the version 11 + +```toml +[target.example] +type = "executable" +compile-features = [ "cxx_std_20", "c_std_11" ] +``` diff --git a/docs/examples/import-from-folder.markdown b/docs/examples/import-from-folder.markdown new file mode 100644 index 0000000..67d86ac --- /dev/null +++ b/docs/examples/import-from-folder.markdown @@ -0,0 +1,20 @@ +--- +layout: page +title: Import content from existing folders +permalink: /examples/quickstart +parent: Examples +nav_order: 4 +--- + +# Import content from existing folders + +Importing one project by targeting the folder path + +```toml +[fetch-content] +zydis = { git = "https://github.com/zyantific/zydis.git", tag = "v3.1.0" } + +[target.example] +type = "executable" +link-libraries = ["zydis"] +``` diff --git a/docs/examples/import-from-git.markdown b/docs/examples/import-from-git.markdown new file mode 100644 index 0000000..2322d2c --- /dev/null +++ b/docs/examples/import-from-git.markdown @@ -0,0 +1,22 @@ +--- +layout: page +title: Import content from Github +permalink: /examples/quickstart +parent: Examples +nav_order: 2 +--- + +# Import content from Github + +Importing an existing project called Zydis to my project + +tag is optional but you can target any branch with it + +```toml +[fetch-content] +zydis = { git = "https://github.com/zyantific/zydis.git", tag = "v3.1.0" } + +[target.example] +type = "executable" +link-libraries = ["zydis"] +``` diff --git a/docs/examples/index.markdown b/docs/examples/index.markdown new file mode 100644 index 0000000..4864791 --- /dev/null +++ b/docs/examples/index.markdown @@ -0,0 +1,10 @@ +--- +layout: page +title: Examples +permalink: /examples/ +nav_order: 4 +has_children: true +--- + +# Examples + diff --git a/docs/examples/quickstart.markdown b/docs/examples/quickstart.markdown new file mode 100644 index 0000000..0124e18 --- /dev/null +++ b/docs/examples/quickstart.markdown @@ -0,0 +1,23 @@ +--- +layout: page +title: Quickstart +permalink: /examples/quickstart +parent: Examples +nav_order: 0 +--- + +# Quickstart + +Smallest possible start point you can have using cmkr + +```toml +[cmake] +version = "3.15" + +[project] +name = "hello-world" + +[target.hello-world] +type = "executable" +sources = [ "src/*.cpp" ] +``` \ No newline at end of file diff --git a/docs/usage.markdown b/docs/usage.markdown index 5dd853a..6b20d82 100644 --- a/docs/usage.markdown +++ b/docs/usage.markdown @@ -2,6 +2,7 @@ layout: page title: Usage permalink: /usage/ +nav_order: 2 --- # Usage