shopify-cli 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. checksums.yaml +7 -0
  2. data/.github/CODEOWNERS +1 -0
  3. data/.github/CODE_OF_CONDUCT.md +73 -0
  4. data/.github/CONTRIBUTING.md +51 -0
  5. data/.github/DESIGN.md +153 -0
  6. data/.github/ISSUE_TEMPLATE.md +38 -0
  7. data/.github/PULL_REQUEST_TEMPLATE.md +22 -0
  8. data/.github/probots.yml +3 -0
  9. data/.gitignore +19 -0
  10. data/.rubocop.yml +47 -0
  11. data/.ruby-version +1 -0
  12. data/.travis.yml +12 -0
  13. data/Gemfile +22 -0
  14. data/Gemfile.lock +77 -0
  15. data/LICENSE.md +7 -0
  16. data/README.md +13 -0
  17. data/Rakefile +101 -0
  18. data/SECURITY.md +59 -0
  19. data/Vagrantfile +17 -0
  20. data/bin/load_shopify.rb +20 -0
  21. data/bin/shopify +32 -0
  22. data/dev.yml +17 -0
  23. data/docs/Gemfile +5 -0
  24. data/docs/Gemfile.lock +248 -0
  25. data/docs/_config.yml +16 -0
  26. data/docs/_data/nav.yml +26 -0
  27. data/docs/_includes/footer.html +15 -0
  28. data/docs/_includes/head.html +19 -0
  29. data/docs/_includes/sidebar_nav.html +22 -0
  30. data/docs/_includes/toc.html +112 -0
  31. data/docs/_layouts/default.html +79 -0
  32. data/docs/app/node/commands/index.md +82 -0
  33. data/docs/app/node/index.md +35 -0
  34. data/docs/app/rails/commands/index.md +80 -0
  35. data/docs/app/rails/index.md +36 -0
  36. data/docs/core/index.md +70 -0
  37. data/docs/css/docs.css +157 -0
  38. data/docs/getting-started/index.md +61 -0
  39. data/docs/help/start-app/index.md +6 -0
  40. data/docs/images/header.png +0 -0
  41. data/docs/index.md +27 -0
  42. data/docs/installing-ruby.md +28 -0
  43. data/ext/shopify-cli/extconf.rb +27 -0
  44. data/install.sh +7 -0
  45. data/lib/docgen/class_template.md.erb +81 -0
  46. data/lib/docgen/index_template.md.erb +5 -0
  47. data/lib/docgen/markdown.rb +101 -0
  48. data/lib/graphql/admin_introspection.graphql +87 -0
  49. data/lib/graphql/all_organizations.graphql +19 -0
  50. data/lib/graphql/all_orgs_with_apps.graphql +30 -0
  51. data/lib/graphql/api_versions.graphql +6 -0
  52. data/lib/graphql/convert_dev_to_test_store.graphql +10 -0
  53. data/lib/graphql/create_app.graphql +20 -0
  54. data/lib/graphql/create_customer.graphql +9 -0
  55. data/lib/graphql/create_draft_order.graphql +8 -0
  56. data/lib/graphql/create_product.graphql +9 -0
  57. data/lib/graphql/extension_create.graphql +21 -0
  58. data/lib/graphql/extension_update_draft.graphql +18 -0
  59. data/lib/graphql/find_organization.graphql +17 -0
  60. data/lib/graphql/get_app_urls.graphql +6 -0
  61. data/lib/graphql/update_dashboard_urls.graphql +8 -0
  62. data/lib/project_types/extension/cli.rb +71 -0
  63. data/lib/project_types/extension/commands/build.rb +29 -0
  64. data/lib/project_types/extension/commands/create.rb +49 -0
  65. data/lib/project_types/extension/commands/extension_command.rb +22 -0
  66. data/lib/project_types/extension/commands/push.rb +69 -0
  67. data/lib/project_types/extension/commands/register.rb +78 -0
  68. data/lib/project_types/extension/commands/serve.rb +24 -0
  69. data/lib/project_types/extension/commands/tunnel.rb +69 -0
  70. data/lib/project_types/extension/extension_project.rb +85 -0
  71. data/lib/project_types/extension/extension_project_keys.rb +10 -0
  72. data/lib/project_types/extension/features/argo.rb +48 -0
  73. data/lib/project_types/extension/features/argo_dependencies.rb +28 -0
  74. data/lib/project_types/extension/features/argo_setup.rb +54 -0
  75. data/lib/project_types/extension/features/argo_setup_step.rb +31 -0
  76. data/lib/project_types/extension/features/argo_setup_steps.rb +53 -0
  77. data/lib/project_types/extension/features/tunnel_url.rb +20 -0
  78. data/lib/project_types/extension/forms/create.rb +52 -0
  79. data/lib/project_types/extension/forms/register.rb +48 -0
  80. data/lib/project_types/extension/messages/message_loading.rb +37 -0
  81. data/lib/project_types/extension/messages/messages.rb +126 -0
  82. data/lib/project_types/extension/models/app.rb +14 -0
  83. data/lib/project_types/extension/models/registration.rb +19 -0
  84. data/lib/project_types/extension/models/type.rb +76 -0
  85. data/lib/project_types/extension/models/types/checkout_post_purchase.rb +20 -0
  86. data/lib/project_types/extension/models/types/subscription_management.rb +20 -0
  87. data/lib/project_types/extension/models/validation_error.rb +17 -0
  88. data/lib/project_types/extension/models/version.rb +15 -0
  89. data/lib/project_types/extension/tasks/converters/registration_converter.rb +26 -0
  90. data/lib/project_types/extension/tasks/converters/validation_error_converter.rb +25 -0
  91. data/lib/project_types/extension/tasks/converters/version_converter.rb +28 -0
  92. data/lib/project_types/extension/tasks/create_extension.rb +31 -0
  93. data/lib/project_types/extension/tasks/get_apps.rb +34 -0
  94. data/lib/project_types/extension/tasks/update_draft.rb +29 -0
  95. data/lib/project_types/extension/tasks/user_errors.rb +45 -0
  96. data/lib/project_types/node/cli.rb +37 -0
  97. data/lib/project_types/node/commands/create.rb +117 -0
  98. data/lib/project_types/node/commands/deploy.rb +22 -0
  99. data/lib/project_types/node/commands/deploy/heroku.rb +91 -0
  100. data/lib/project_types/node/commands/generate.rb +51 -0
  101. data/lib/project_types/node/commands/generate/billing.rb +37 -0
  102. data/lib/project_types/node/commands/generate/page.rb +55 -0
  103. data/lib/project_types/node/commands/generate/webhook.rb +33 -0
  104. data/lib/project_types/node/commands/open.rb +16 -0
  105. data/lib/project_types/node/commands/populate.rb +23 -0
  106. data/lib/project_types/node/commands/populate/customer.rb +31 -0
  107. data/lib/project_types/node/commands/populate/draft_order.rb +28 -0
  108. data/lib/project_types/node/commands/populate/product.rb +30 -0
  109. data/lib/project_types/node/commands/serve.rb +45 -0
  110. data/lib/project_types/node/commands/tunnel.rb +39 -0
  111. data/lib/project_types/node/forms/create.rb +87 -0
  112. data/lib/project_types/node/messages/messages.rb +260 -0
  113. data/lib/project_types/rails/cli.rb +41 -0
  114. data/lib/project_types/rails/commands/create.rb +126 -0
  115. data/lib/project_types/rails/commands/deploy.rb +22 -0
  116. data/lib/project_types/rails/commands/deploy/heroku.rb +113 -0
  117. data/lib/project_types/rails/commands/generate.rb +49 -0
  118. data/lib/project_types/rails/commands/generate/webhook.rb +39 -0
  119. data/lib/project_types/rails/commands/open.rb +16 -0
  120. data/lib/project_types/rails/commands/populate.rb +23 -0
  121. data/lib/project_types/rails/commands/populate/customer.rb +31 -0
  122. data/lib/project_types/rails/commands/populate/draft_order.rb +28 -0
  123. data/lib/project_types/rails/commands/populate/product.rb +30 -0
  124. data/lib/project_types/rails/commands/serve.rb +47 -0
  125. data/lib/project_types/rails/commands/tunnel.rb +39 -0
  126. data/lib/project_types/rails/forms/create.rb +116 -0
  127. data/lib/project_types/rails/gem.rb +56 -0
  128. data/lib/project_types/rails/messages/messages.rb +283 -0
  129. data/lib/project_types/rails/ruby.rb +17 -0
  130. data/lib/project_types/script/cli.rb +76 -0
  131. data/lib/project_types/script/commands/create.rb +45 -0
  132. data/lib/project_types/script/commands/disable.rb +36 -0
  133. data/lib/project_types/script/commands/enable.rb +46 -0
  134. data/lib/project_types/script/commands/push.rb +39 -0
  135. data/lib/project_types/script/config/extension_points.yml +18 -0
  136. data/lib/project_types/script/errors.rb +16 -0
  137. data/lib/project_types/script/forms/create.rb +29 -0
  138. data/lib/project_types/script/forms/enable.rb +24 -0
  139. data/lib/project_types/script/forms/push.rb +19 -0
  140. data/lib/project_types/script/forms/script_form.rb +66 -0
  141. data/lib/project_types/script/graphql/app_script_update_or_create.graphql +27 -0
  142. data/lib/project_types/script/graphql/script_service_proxy.graphql +8 -0
  143. data/lib/project_types/script/graphql/shop_script_delete.graphql +14 -0
  144. data/lib/project_types/script/graphql/shop_script_update_or_create.graphql +28 -0
  145. data/lib/project_types/script/layers/application/build_script.rb +43 -0
  146. data/lib/project_types/script/layers/application/create_script.rb +47 -0
  147. data/lib/project_types/script/layers/application/disable_script.rb +19 -0
  148. data/lib/project_types/script/layers/application/enable_script.rb +21 -0
  149. data/lib/project_types/script/layers/application/extension_points.rb +17 -0
  150. data/lib/project_types/script/layers/application/project_dependencies.rb +34 -0
  151. data/lib/project_types/script/layers/application/push_script.rb +30 -0
  152. data/lib/project_types/script/layers/domain/errors.rb +25 -0
  153. data/lib/project_types/script/layers/domain/extension_point.rb +29 -0
  154. data/lib/project_types/script/layers/domain/push_package.rb +29 -0
  155. data/lib/project_types/script/layers/domain/script.rb +18 -0
  156. data/lib/project_types/script/layers/infrastructure/assemblyscript_dependency_manager.rb +73 -0
  157. data/lib/project_types/script/layers/infrastructure/assemblyscript_tsconfig.rb +38 -0
  158. data/lib/project_types/script/layers/infrastructure/assemblyscript_wasm_builder.rb +39 -0
  159. data/lib/project_types/script/layers/infrastructure/dependency_manager.rb +36 -0
  160. data/lib/project_types/script/layers/infrastructure/errors.rb +38 -0
  161. data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +31 -0
  162. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +47 -0
  163. data/lib/project_types/script/layers/infrastructure/script_builder.rb +34 -0
  164. data/lib/project_types/script/layers/infrastructure/script_repository.rb +89 -0
  165. data/lib/project_types/script/layers/infrastructure/script_service.rb +165 -0
  166. data/lib/project_types/script/layers/infrastructure/test_suite_repository.rb +59 -0
  167. data/lib/project_types/script/messages/messages.rb +204 -0
  168. data/lib/project_types/script/script_project.rb +37 -0
  169. data/lib/project_types/script/templates/ts/as-pect.config.js +21 -0
  170. data/lib/project_types/script/ui/error_handler.rb +136 -0
  171. data/lib/project_types/script/ui/strict_spinner.rb +22 -0
  172. data/lib/rubygems_plugin.rb +18 -0
  173. data/lib/shopify-cli/admin_api.rb +99 -0
  174. data/lib/shopify-cli/admin_api/populate_resource_command.rb +165 -0
  175. data/lib/shopify-cli/admin_api/schema.rb +32 -0
  176. data/lib/shopify-cli/api.rb +104 -0
  177. data/lib/shopify-cli/command.rb +67 -0
  178. data/lib/shopify-cli/commands.rb +28 -0
  179. data/lib/shopify-cli/commands/connect.rb +108 -0
  180. data/lib/shopify-cli/commands/create.rb +50 -0
  181. data/lib/shopify-cli/commands/help.rb +79 -0
  182. data/lib/shopify-cli/commands/logout.rb +23 -0
  183. data/lib/shopify-cli/commands/system.rb +135 -0
  184. data/lib/shopify-cli/commands/version.rb +15 -0
  185. data/lib/shopify-cli/context.rb +372 -0
  186. data/lib/shopify-cli/core.rb +9 -0
  187. data/lib/shopify-cli/core/entry_point.rb +40 -0
  188. data/lib/shopify-cli/core/executor.rb +21 -0
  189. data/lib/shopify-cli/core/help_resolver.rb +20 -0
  190. data/lib/shopify-cli/core/monorail.rb +118 -0
  191. data/lib/shopify-cli/db.rb +114 -0
  192. data/lib/shopify-cli/form.rb +40 -0
  193. data/lib/shopify-cli/git.rb +141 -0
  194. data/lib/shopify-cli/helpers.rb +5 -0
  195. data/lib/shopify-cli/helpers/haikunator.rb +92 -0
  196. data/lib/shopify-cli/heroku.rb +97 -0
  197. data/lib/shopify-cli/js_deps.rb +110 -0
  198. data/lib/shopify-cli/js_system.rb +98 -0
  199. data/lib/shopify-cli/messages/messages.rb +287 -0
  200. data/lib/shopify-cli/oauth.rb +192 -0
  201. data/lib/shopify-cli/oauth/servlet.rb +61 -0
  202. data/lib/shopify-cli/options.rb +40 -0
  203. data/lib/shopify-cli/packager.rb +116 -0
  204. data/lib/shopify-cli/partners_api.rb +114 -0
  205. data/lib/shopify-cli/partners_api/organizations.rb +32 -0
  206. data/lib/shopify-cli/process_supervision.rb +187 -0
  207. data/lib/shopify-cli/project.rb +191 -0
  208. data/lib/shopify-cli/project_type.rb +83 -0
  209. data/lib/shopify-cli/resources.rb +5 -0
  210. data/lib/shopify-cli/resources/env_file.rb +96 -0
  211. data/lib/shopify-cli/sub_command.rb +15 -0
  212. data/lib/shopify-cli/task.rb +10 -0
  213. data/lib/shopify-cli/tasks.rb +32 -0
  214. data/lib/shopify-cli/tasks/create_api_client.rb +29 -0
  215. data/lib/shopify-cli/tasks/ensure_dev_store.rb +41 -0
  216. data/lib/shopify-cli/tasks/ensure_env.rb +31 -0
  217. data/lib/shopify-cli/tasks/ensure_loopback_url.rb +20 -0
  218. data/lib/shopify-cli/tasks/update_dashboard_urls.rb +44 -0
  219. data/lib/shopify-cli/tunnel.rb +154 -0
  220. data/lib/shopify-cli/version.rb +3 -0
  221. data/lib/shopify_cli.rb +132 -0
  222. data/shopify-cli.gemspec +40 -0
  223. data/shopify.fish +12 -0
  224. data/shopify.sh +11 -0
  225. data/vendor/deps/cli-kit/REVISION +1 -0
  226. data/vendor/deps/cli-kit/lib/cli/kit.rb +60 -0
  227. data/vendor/deps/cli-kit/lib/cli/kit/autocall.rb +21 -0
  228. data/vendor/deps/cli-kit/lib/cli/kit/base_command.rb +49 -0
  229. data/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb +94 -0
  230. data/vendor/deps/cli-kit/lib/cli/kit/config.rb +133 -0
  231. data/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +115 -0
  232. data/vendor/deps/cli-kit/lib/cli/kit/executor.rb +81 -0
  233. data/vendor/deps/cli-kit/lib/cli/kit/ini.rb +102 -0
  234. data/vendor/deps/cli-kit/lib/cli/kit/levenshtein.rb +82 -0
  235. data/vendor/deps/cli-kit/lib/cli/kit/logger.rb +76 -0
  236. data/vendor/deps/cli-kit/lib/cli/kit/resolver.rb +60 -0
  237. data/vendor/deps/cli-kit/lib/cli/kit/ruby_backports/enumerable.rb +6 -0
  238. data/vendor/deps/cli-kit/lib/cli/kit/support.rb +9 -0
  239. data/vendor/deps/cli-kit/lib/cli/kit/support/test_helper.rb +244 -0
  240. data/vendor/deps/cli-kit/lib/cli/kit/system.rb +207 -0
  241. data/vendor/deps/cli-kit/lib/cli/kit/util.rb +189 -0
  242. data/vendor/deps/cli-kit/lib/cli/kit/version.rb +5 -0
  243. data/vendor/deps/cli-ui/REVISION +1 -0
  244. data/vendor/deps/cli-ui/lib/cli/ui.rb +187 -0
  245. data/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +153 -0
  246. data/vendor/deps/cli-ui/lib/cli/ui/box.rb +15 -0
  247. data/vendor/deps/cli-ui/lib/cli/ui/color.rb +79 -0
  248. data/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +179 -0
  249. data/vendor/deps/cli-ui/lib/cli/ui/frame.rb +310 -0
  250. data/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +78 -0
  251. data/vendor/deps/cli-ui/lib/cli/ui/progress.rb +88 -0
  252. data/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +248 -0
  253. data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +472 -0
  254. data/vendor/deps/cli-ui/lib/cli/ui/prompt/options_handler.rb +24 -0
  255. data/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +48 -0
  256. data/vendor/deps/cli-ui/lib/cli/ui/spinner/async.rb +40 -0
  257. data/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +241 -0
  258. data/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb +227 -0
  259. data/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +36 -0
  260. data/vendor/deps/cli-ui/lib/cli/ui/truncater.rb +102 -0
  261. data/vendor/deps/cli-ui/lib/cli/ui/version.rb +5 -0
  262. data/vendor/deps/smart_properties/REVISION +1 -0
  263. data/vendor/deps/smart_properties/lib/smart_properties.rb +174 -0
  264. data/vendor/deps/smart_properties/lib/smart_properties/errors.rb +114 -0
  265. data/vendor/deps/smart_properties/lib/smart_properties/property.rb +162 -0
  266. data/vendor/deps/smart_properties/lib/smart_properties/property_collection.rb +83 -0
  267. data/vendor/deps/smart_properties/lib/smart_properties/validations.rb +8 -0
  268. data/vendor/deps/smart_properties/lib/smart_properties/validations/ancestor.rb +27 -0
  269. data/vendor/deps/smart_properties/lib/smart_properties/version.rb +3 -0
  270. data/vendor/lib/semantic/LICENSE +20 -0
  271. data/vendor/lib/semantic/semantic.rb +4 -0
  272. data/vendor/lib/semantic/version.rb +180 -0
  273. metadata +374 -0
@@ -0,0 +1,16 @@
1
+ title: Shopify App CLI
2
+ markdown: kramdown
3
+ url: https://shopify.github.io
4
+ baseurl: /shopify-app-cli
5
+
6
+ exclude: [
7
+ 'heroku/',
8
+ 'Gemfile',
9
+ 'Gemfile.lock'
10
+ ]
11
+
12
+ defaults:
13
+ - scope:
14
+ path: ""
15
+ values:
16
+ toc: true
@@ -0,0 +1,26 @@
1
+ sidebar:
2
+ - title: Introduction
3
+ section: intro
4
+ url: /
5
+ - title: Getting started
6
+ section: getting-started
7
+ url: /getting-started/
8
+ - title: Core commands
9
+ section: core
10
+ url: /core/
11
+ - title: Node app projects
12
+ section: node
13
+ url: /app/node/
14
+ subnav:
15
+ - title: Getting started
16
+ url: /app/node/
17
+ - title: Command reference
18
+ url: /app/node/commands/
19
+ - title: Rails app projects
20
+ section: rails
21
+ url: /app/rails/
22
+ subnav:
23
+ - title: Getting started
24
+ url: /app/rails/
25
+ - title: Command reference
26
+ url: /app/rails/commands/
@@ -0,0 +1,15 @@
1
+ <div class="page-container page-container--footer">
2
+ <footer class="footer--main" role="contentinfo">
3
+ <div class="footer-bottom">
4
+ <div class="grid">
5
+ <div class="grid__item color-white">
6
+ <p>
7
+ Built and maintained by <a href="https://www.shopify.com">Shopify Inc.</a> © {{ site.time | date: '%Y' }}.
8
+ Want to contribute? <a href="https://www.shopify.com/careers">Join the team</a>
9
+ </p>
10
+ </div>
11
+ </div>
12
+ </div>
13
+
14
+ </footer>
15
+ </div>
@@ -0,0 +1,19 @@
1
+ <meta charset="utf-8">
2
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
3
+
4
+ <title>{% if page.title %}{{ page.title }} · {% endif %}{{ site.title }}</title>
5
+
6
+ {% if page.description %}
7
+ <meta name="description" content="{{ site.github.project_tagline }}">
8
+ {% endif %}
9
+
10
+ <link rel="canonical" href="https://shopify.github.io/shopify-app-cli/">
11
+
12
+ <meta name="robots" content="index, follow">
13
+ <meta name="st:robots" content="index, follow">
14
+ <meta name="viewport" content="width=device-width, initial-scale=1">
15
+ <meta property='st:title' content="{{ site.title }}">
16
+
17
+ <link rel="shortcut icon" type="image/png" href="https://cdn.shopify.com/shopify-marketing_assets/static/shopify-favicon.png" />
18
+ <link href="https://cdn.shopify.com/shopify-marketing_assets/builds/88.3.2/marketing_assets.css" rel="stylesheet" type="text/css">
19
+ <link href="{{ '/css/docs.css' | relative_url }}" rel="stylesheet" type="text/css">
@@ -0,0 +1,22 @@
1
+ <ul class="in-page-menu in-page-menu--vertical">
2
+ {% for item in site.data.nav.sidebar %}
3
+ <li>
4
+ <a class="{% if item.url == page.url %}is-active{% endif %}" href="{{ item.url | relative_url }}">{{ item.title }}</a>
5
+ {% if item.section == page.section %}
6
+ <ul>
7
+ {% for subitem in item.subnav %}
8
+ <li><a class="{% if subitem.url == page.url %}is-active{% endif %}" href="{{ subitem.url | relative_url }}">{{ subitem.title }}</a></li>
9
+ {% endfor %}
10
+ </ul>
11
+ {% endif %}
12
+ </li>
13
+ {% endfor %}
14
+ </ul>
15
+
16
+ <p>
17
+ <a href="{{ site.github.repository_url }}" class="link--external">GitHub repository</a>
18
+ </p>
19
+
20
+ <p>
21
+ <a href="https://shopify.dev/" class="link--external">Shopify Developer Docs</a><br />
22
+ </p>
@@ -0,0 +1,112 @@
1
+ {% capture tocWorkspace %}
2
+ {% comment %}
3
+ Version 1.0.11
4
+ https://github.com/allejo/jekyll-toc
5
+
6
+ "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
7
+
8
+ Usage:
9
+ {% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
10
+
11
+ Parameters:
12
+ * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
13
+
14
+ Optional Parameters:
15
+ * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
16
+ * class (string) : '' - a CSS class assigned to the TOC
17
+ * id (string) : '' - an ID to assigned to the TOC
18
+ * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
19
+ * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
20
+ * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
21
+ * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
22
+ * baseurl (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
23
+ * anchor_class (string) : '' - add custom class(es) for each anchor element
24
+ * skipNoIDs (bool) : false - skip headers that do not have an `id` attribute
25
+
26
+ Output:
27
+ An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
28
+ generate the table of contents and will NOT output the markdown given to it
29
+ {% endcomment %}
30
+
31
+ {% capture my_toc %}{% endcapture %}
32
+ {% assign orderedList = include.ordered | default: false %}
33
+ {% assign skipNoIDs = include.skipNoIDs | default: false %}
34
+ {% assign minHeader = include.h_min | default: 1 %}
35
+ {% assign maxHeader = include.h_max | default: 6 %}
36
+ {% assign nodes = include.html | split: '<h' %}
37
+ {% assign firstHeader = true %}
38
+
39
+ {% capture listModifier %}{% if orderedList %}1.{% else %}-{% endif %}{% endcapture %}
40
+
41
+ {% for node in nodes %}
42
+ {% if node == "" %}
43
+ {% continue %}
44
+ {% endif %}
45
+
46
+ {% if skipNoIDs == true %}
47
+ {% unless node contains "id=" %}
48
+ {% continue %}
49
+ {% endunless %}
50
+ {% endif %}
51
+
52
+ {% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
53
+
54
+ {% if headerLevel < minHeader or headerLevel > maxHeader %}
55
+ {% continue %}
56
+ {% endif %}
57
+
58
+ {% if firstHeader %}
59
+ {% assign firstHeader = false %}
60
+ {% assign minHeader = headerLevel %}
61
+ {% endif %}
62
+
63
+ {% assign indentAmount = headerLevel | minus: minHeader %}
64
+ {% assign _workspace = node | split: '</h' %}
65
+
66
+ {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
67
+ {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
68
+ {% assign html_id = _idWorkspace[0] %}
69
+
70
+ {% assign _classWorkspace = _workspace[0] | split: 'class="' %}
71
+ {% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
72
+ {% assign html_class = _classWorkspace[0] %}
73
+
74
+ {% if html_class contains "no_toc" %}
75
+ {% continue %}
76
+ {% endif %}
77
+
78
+ {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
79
+ {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
80
+
81
+ {% assign space = '' %}
82
+ {% for i in (1..indentAmount) %}
83
+ {% assign space = space | prepend: ' ' %}
84
+ {% endfor %}
85
+
86
+ {% if include.item_class and include.item_class != blank %}
87
+ {% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
88
+ {% endif %}
89
+
90
+ {% capture anchor_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
91
+ {% capture anchor_body %}{{ anchor_body | replace: "|", "\|" }}{% endcapture %}
92
+
93
+ {% if html_id %}
94
+ {% capture list_item %}[{{ anchor_body }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% endcapture %}
95
+ {% else %}
96
+ {% capture list_item %}{{ anchor_body }}{% endcapture %}
97
+ {% endif %}
98
+
99
+ {% capture my_toc %}{{ my_toc }}
100
+ {{ space }}{{ listModifier }} {{ listItemClass }} {{ list_item }}{% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %}
101
+ {% endfor %}
102
+
103
+ {% if include.class and include.class != blank %}
104
+ {% capture my_toc %}{:.{{ include.class }}}
105
+ {{ my_toc | lstrip }}{% endcapture %}
106
+ {% endif %}
107
+
108
+ {% if include.id %}
109
+ {% capture my_toc %}{: #{{ include.id }}}
110
+ {{ my_toc | lstrip }}{% endcapture %}
111
+ {% endif %}
112
+ {% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
@@ -0,0 +1,79 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ {% include head.html %}
5
+ </head>
6
+ <body>
7
+ <div id="GlobalIconSymbols" style="display: none;"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="search"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M14.312 12.897l5.395 5.396a1 1 0 11-1.414 1.414l-5.396-5.395A7.954 7.954 0 018 16c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8a7.946 7.946 0 01-1.688 4.897zM8 2C4.691 2 2 4.691 2 8s2.691 6 6 6 6-2.691 6-6-2.691-6-6-6z" clip-rule="evenodd"></path></svg></symbol><symbol id="modules-arrow-right"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17.707 9.293l-5-5c-.39-.39-1.023-.39-1.414 0s-.39 1.023 0 1.414L14.586 9H3c-.553 0-1 .448-1 1s.447 1 1 1h11.586l-3.293 3.293c-.39.39-.39 1.023 0 1.414.195.195.45.293.707.293s.512-.098.707-.293l5-5c.39-.39.39-1.023 0-1.414z"></path></svg>
8
+ </symbol><symbol id="shopify-developers-logo"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 948.88 142.83"><path fill="#95bf46" d="M107.41 27.15a1.35 1.35 0 0 0-1.22-1.15L95 25.18 86.7 17c-.82-.82-2.41-.57-3-.39l-4.2 1.27C77 10.72 72.63 4.14 64.91 4.14h-.65C62.06 1.26 59.34 0 57 0 39 0 30.41 22.48 27.72 33.91l-12.59 3.9c-3.9 1.22-4 1.35-4.54 5C10.21 45.62 0 124.55 0 124.55l79.54 14.9 43.09-9.32S107.5 27.85 107.41 27.15zm-32.3-7.92l-6.73 2.08v-1.45A33 33 0 0 0 66.77 9c3.98.5 6.63 5 8.34 10.24zM61.84 9.88c1.11 2.77 1.82 6.75 1.82 12.12v.78l-13.9 4.3c2.68-10.33 7.69-15.32 12.08-17.2zm-5.35-5.06a4.06 4.06 0 0 1 2.31.78C53 8.32 46.86 15.15 44.25 28.79l-11 3.4c3.07-10.4 10.33-27.37 23.24-27.37z"></path><path fill="#5f8e3e" d="M106.19 26L95 25.18 86.7 17a2 2 0 0 0-1.15-.53l-6 123 43.09-9.32s-15.13-102.28-15.22-103a1.35 1.35 0 0 0-1.23-1.15z"></path><path fill="#fff" d="M64.91 49.83l-5.32 15.81a24.44 24.44 0 0 0-10.36-2.49c-8.37 0-8.79 5.25-8.79 6.57 0 7.22 18.82 10 18.82 26.89 0 13.3-8.44 21.87-19.82 21.87-13.65 0-20.64-8.5-20.64-8.5l3.66-12.08s7.18 6.16 13.23 6.16a5.34 5.34 0 0 0 5.57-5.39c0-9.42-15.44-9.84-15.44-25.31 0-13 9.35-25.63 28.22-25.63 7.27.02 10.87 2.1 10.87 2.1z"></path><path fill="#fff" d="M172.87 79.46c-4.3-2.33-6.51-4.3-6.51-7 0-3.44 3.07-5.65 7.86-5.65a28.08 28.08 0 0 1 10.56 2.33l3.93-12s-3.61-2.82-14.24-2.82c-14.8 0-25.05 8.47-25.05 20.38 0 6.75 4.79 11.91 11.17 15.59 5.16 2.95 7 5 7 8.1s-2.58 5.77-7.37 5.77c-7.13 0-13.88-3.68-13.88-3.68l-4.17 12s6.23 4.17 16.7 4.17c15.23 0 26.16-7.49 26.16-21-.03-7.22-5.53-12.38-12.16-16.19zm60.66-25.29c-7.49 0-13.38 3.56-17.93 9l-.25-.12 6.51-34h-16.94l-16.46 86.57h16.95L211.06 86c2.21-11.17 8-18.05 13.38-18.05 3.81 0 5.28 2.58 5.28 6.26a38.72 38.72 0 0 1-.74 7.49l-6.39 33.89h16.95l6.63-35a63.31 63.31 0 0 0 1.23-11.05c.01-9.6-5.03-15.37-13.87-15.37zm52.19 0c-20.38 0-33.89 18.42-33.89 38.93 0 13.14 8.1 23.7 23.33 23.7 20 0 33.52-17.93 33.52-38.93 0-12.16-7.12-23.7-22.96-23.7zm-8.35 49.61c-5.77 0-8.23-4.91-8.23-11.05 0-9.7 5-25.54 14.24-25.54 6 0 8 5.16 8 10.19-.01 10.44-5.05 26.4-14.01 26.4zM352 54.17c-11.44 0-17.93 10.07-17.93 10.07h-.25l1-9.09h-15c-.74 6.14-2.09 15.47-3.44 22.47l-11.79 62h16.95l4.67-25.05h.37s3.48 2.21 9.95 2.21c19.89 0 32.91-20.38 32.91-41 .03-11.42-5.01-21.61-17.44-21.61zM335.82 104a10.76 10.76 0 0 1-7-2.46l2.82-15.84c2-10.56 7.49-17.56 13.38-17.56 5.16 0 6.75 4.79 6.75 9.33.01 10.96-6.49 26.53-15.95 26.53zm57.84-74.15a9.67 9.67 0 0 0-9.7 9.82c0 5 3.19 8.47 8 8.47h.25a9.57 9.57 0 0 0 9.95-9.82 8.06 8.06 0 0 0-8.5-8.47zm-23.7 85.72h16.95l11.54-60.05h-17.07l-11.42 60.05zm71.59-60.17h-11.79l.61-2.82c1-5.77 4.42-10.93 10.07-10.93a17.66 17.66 0 0 1 5.4.86l3.32-13.26s-2.95-1.47-9.21-1.47c-6 0-12 1.72-16.58 5.65-5.77 4.91-8.47 12-9.82 19.16l-.49 2.82h-7.86l-2.46 12.77h7.86l-9 47.4h16.95l9-47.4h11.67zM467 96.78h-.25c-.33-4.69-4.18-41.26-4.18-41.26h-17.83l10.19 55.14a3.61 3.61 0 0 1-.37 2.82 29 29 0 0 1-9.21 10.19 36.65 36.65 0 0 1-9.58 4.79l4.67 14.37a38.7 38.7 0 0 0 16.56-9.21c7.74-7.25 14.86-18.42 22.23-33.65L500 55.52h-17.68S471.72 82.21 467 96.78zm90.73-39.51c-2.36-1.49-6.57-2.48-10.54-2.48-19.22 0-33.61 21-33.61 41.92 0 10.79 4.84 20.09 15.5 20.09 8.56 0 15.5-5.33 20.22-13.39h.25l-1.74 12.15h5.08a160.79 160.79 0 0 1 2.36-17.86l13.15-69.57h-5.33zm-5.83 30.26c-2.73 14.88-13.15 24.56-21.33 24.56-9.43 0-11.41-8.56-11.41-16 0-17.12 11.66-36.59 27.29-36.59 4.59 0 7.94 1.24 10 3zm45.89-32.74c-17 0-29 22.45-29 39.56 0 11.41 4.84 22.32 18.73 22.32a29.58 29.58 0 0 0 16.25-4.46l-1.64-4.21a25.94 25.94 0 0 1-13.77 4c-6.33 0-10.91-3.35-13-10-1.24-4.34-1.12-12.15-.5-14.88 19.47.12 36.83-4.09 36.83-19.22-.01-6.78-4.1-13.11-13.9-13.11zm8.31 13.27c0 11.78-14.88 14.39-30.39 14.26 3.72-12.9 11.91-22.82 21.08-22.82 5.58 0 9.3 3 9.3 8.43zM657.07 56l-20.22 39.35A137.07 137.07 0 0 0 631 108h-.37c0-2.85-.74-7.32-1.61-13.52L623.83 56h-5.33l8.31 59.53h5l31-59.53zm32.74-1.21c-17 0-29 22.45-29 39.56 0 11.41 4.84 22.32 18.73 22.32a29.58 29.58 0 0 0 16.25-4.46l-1.64-4.21a25.94 25.94 0 0 1-13.77 4c-6.33 0-10.91-3.35-13-10-1.24-4.34-1.12-12.15-.5-14.88 19.47.12 36.83-4.09 36.83-19.22-.01-6.78-4.1-13.11-13.9-13.11zm8.31 13.27c0 11.78-14.88 14.39-30.39 14.26 3.72-12.9 11.91-22.82 21.08-22.82 5.58 0 9.3 3 9.3 8.43zm8.55 47.5h5.34l16.62-87.43h-5.46l-16.5 87.43zm51.72-60.77c-18.11 0-29.39 21.58-29.39 38.95 0 12.28 6.08 23.07 19 23.07h.12c19.22 0 29.27-23.81 29.27-39.07-.02-10.79-4.74-22.95-19-22.95zm-9.55 57.3h-.12c-9.3 0-14.14-8.43-14.14-18.85 0-15.24 9.42-33.74 23.31-33.74 10.91 0 13.89 10.42 13.89 18.23.01 14.27-9.42 34.36-22.94 34.36zm67.96-57.3c-7.94 0-15.38 5.08-20.71 13.27h-.25l1.86-12h-5.08c-.74 5.46-1.86 12.65-3.35 20.46l-11.91 63.38h5.33l4.71-25.67h.25c2.23 1.24 6.08 2.6 11.91 2.6 19 0 32.74-22.57 32.74-42.66.01-9.83-4.21-19.38-15.5-19.38zm-16.74 57.3c-4.84 0-8.81-1.24-11.53-3.35l3.84-20.46c3.35-18 14.39-28.77 22.82-28.77 8.81 0 11.53 7.94 11.53 15 0 15.26-10.91 37.58-26.66 37.58zm67.09-57.3c-17 0-29 22.45-29 39.56 0 11.41 4.84 22.32 18.73 22.32a29.58 29.58 0 0 0 16.25-4.46l-1.64-4.21a25.94 25.94 0 0 1-13.77 4c-6.33 0-10.91-3.35-13-10-1.24-4.34-1.12-12.15-.5-14.88 19.47.12 36.83-4.09 36.83-19.22-.05-6.78-4.05-13.11-13.9-13.11zm8.31 13.27c0 11.78-14.88 14.39-30.39 14.26C848.8 69.43 857 59.5 866.16 59.5c5.58 0 9.3 3 9.3 8.43zM916 60.62l1.12-5.71c-.62 0-1.49-.12-2.23-.12-7.44 0-13.39 6.33-17 14.26h-.25c.74-5.21 1.24-9.18 1.61-13h-4.84c-.5 5.21-1.36 11.91-2.85 19.47L884 115.56h5.33l5.71-30.26c2.48-13 11.16-24.8 19-24.8a8.82 8.82 0 0 1 1.96.12zm22.46-1.12a17 17 0 0 1 8.44 2.5l2-4.59c-1.74-1.36-5.71-2.6-9.8-2.6-10.54 0-18.11 7.57-18.11 16.87 0 5.58 3.22 10.91 9.18 14.76 5.58 3.6 8.06 7.19 8.06 13.15 0 6.82-5.33 12.4-13.15 12.4a18.2 18.2 0 0 1-10.42-3.35l-2.11 4.46c2 1.61 6.7 3.6 12 3.6 10.29 0 19.1-6.57 19.1-18.6 0-6.08-3.47-11.53-9.18-15.38-4.84-3.35-8.06-6.45-8.06-12 .02-6.13 4.86-11.22 12.05-11.22z"></path></svg></symbol><symbol id="modules-caret-right"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-242.1 245.6 6.6 10.3"><path d="M-235.6 250.7l-5.1 5.2-1.4-1.4 3.7-3.8-3.7-3.7 1.4-1.4"></path></svg></symbol><symbol id="modules-nav-external-indicator"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 7 7"><path d="M7,7V0H0L7,7z"></path></svg>
9
+ </symbol><symbol id="modules-caret-down"><svg xmlns="http://www.w3.org/2000/svg" baseProfile="tiny" viewBox="0 0 10.289 6.563"><path d="M5.212 6.563L0 1.423 1.404 0l3.788 3.735L8.865.01l1.424 1.404"></path></svg></symbol><symbol id="modules-mobile-hamburger"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M19 11H1c-.552 0-1-.447-1-1s.448-1 1-1h18c.552 0 1 .447 1 1s-.448 1-1 1zm0-7H1c-.552 0-1-.447-1-1s.448-1 1-1h18c.552 0 1 .447 1 1s-.448 1-1 1zm0 14H1c-.552 0-1-.447-1-1s.448-1 1-1h18c.552 0 1 .447 1 1s-.448 1-1 1z"></path></svg>
10
+ </symbol><symbol id="modules-cancel"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M11.414 10l6.293-6.293c.39-.39.39-1.023 0-1.414s-1.023-.39-1.414 0L10 8.586 3.707 2.293c-.39-.39-1.023-.39-1.414 0s-.39 1.023 0 1.414L8.586 10l-6.293 6.293c-.39.39-.39 1.023 0 1.414.195.195.45.293.707.293s.512-.098.707-.293L10 11.414l6.293 6.293c.195.195.45.293.707.293s.512-.098.707-.293c.39-.39.39-1.023 0-1.414L11.414 10z"></path></svg>
11
+ </symbol><symbol id="modules-social-facebook"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M15.6 30V19.4h5V15h-5v-3.1c0-1 .6-1.9 1.3-1.9h3.8V5.6h-3.8c-3.1 0-5.6 2.8-5.6 6.3V15H7.5v4.4h3.8v10.1C4.8 27.9 0 22 0 15 0 6.7 6.7 0 15 0s15 6.7 15 15c0 8.1-6.4 14.7-14.4 15z"></path></svg>
12
+ </symbol><symbol id="modules-social-twitter"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M30 15c0 8.3-6.7 15-15 15S0 23.3 0 15 6.7 0 15 0s15 6.7 15 15zm-3.7-5.5c-.8.3-1.6.6-2.5.7.9-.5 1.5-1.4 1.8-2.4-.8.5-1.7.8-2.7 1-.8-.8-1.9-1.4-3.1-1.4-2.4 0-4.2 1.9-4.2 4.3 0 .3 0 .7.1 1-3.5-.2-6.7-1.9-8.8-4.5-.3.7-.6 1.4-.6 2.2 0 1.5.7 2.8 1.9 3.5-.7 0-1.4-.2-1.9-.5 0 2.1 1.5 3.8 3.4 4.2-.3.1-.7.1-1.1.1-.3 0-.6 0-.8-.1.5 1.7 2.1 2.8 4 2.9-1.5 1.1-3.3 1.9-5.3 1.9-.3 0-.7 0-1-.1 1.9 1.2 4.1 1.9 6.5 1.9 7.8 0 12.1-6.5 12.1-12.1v-.6c.9-.4 1.6-1.2 2.2-2z"></path></svg>
13
+ </symbol><symbol id="modules-social-youtube"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M30 15c0 8.3-6.7 15-15 15S0 23.3 0 15 6.7 0 15 0s15 6.7 15 15zm-5.6 0c0-6.9 0-6.9-9.4-6.9s-9.4 0-9.4 6.9 0 6.9 9.4 6.9 9.4 0 9.4-6.9zm-11.9-3.7l6.3 3.8-6.3 3.8v-7.6z"></path></svg>
14
+ </symbol><symbol id="modules-social-instagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M15 30C6.7 30 0 23.3 0 15c0-1.1.1-2.1.3-3.1h7.2c-.4 1-.6 2-.6 3.1 0 4.5 3.6 8.1 8.1 8.1s8.1-3.6 8.1-8.1c0-1.1-.2-2.2-.6-3.1h7.2c.2 1 .3 2 .3 3.1 0 8.3-6.7 15-15 15zm5.9-20.6c-1.5-1.5-3.6-2.5-5.9-2.5s-4.4 1-5.9 2.5h-8C3.3 3.9 8.7 0 15 0s11.7 3.9 13.9 9.4h-8zm-.3 5.6c0 3.1-2.5 5.6-5.6 5.6-3.1 0-5.6-2.5-5.6-5.6 0-3.1 2.5-5.6 5.6-5.6 3.1 0 5.6 2.5 5.6 5.6z"></path></svg>
15
+ </symbol><symbol id="modules-social-linkedin"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M30 15c0 8.3-6.7 15-15 15S0 23.3 0 15 6.7 0 15 0s15 6.7 15 15zM11.3 7.8c0-1.2-1-2.2-2.5-2.2s-2.5.9-2.5 2.2c0 1.2 1 2.2 2.5 2.2s2.5-1 2.5-2.2zm-.7 4.1H6.9v10.6h3.8V11.9zm13.8 5c0-3.4-1.7-5.6-4.4-5.6-1.5 0-2.6.9-3.1 2.3l-.1-1.6H13c0 .4.1 2.5.1 2.5v8.1h3.8V17c0-1.5.7-2.5 1.8-2.5s1.9.6 1.9 2.5v5.6h3.8v-5.7z"></path></svg>
16
+ </symbol><symbol id="modules-social-pinterest"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M15 30c-1.5 0-2.9-.2-4.3-.6.6-.9 1.2-2 1.5-3.2.2-.7 1-4.1 1-4.1.5 1 2 1.9 3.7 1.9 4.8 0 8.1-4.4 8.1-10.3 0-4.4-3.8-8.6-9.5-8.6-7.1-.1-10.6 5-10.6 9.3 0 2.6 1 4.9 3.1 5.7.3.1.7 0 .8-.4.1-.2.2-.9.3-1.2.1-.4 0-.5-.2-.8-.6-.7-1-1.6-1-3 0-3.8 2.8-7.2 7.4-7.2 4 0 6.2 2.5 6.2 5.8 0 4.3-1.9 8-4.8 8-1.6 0-2.7-1.3-2.4-2.9.5-1.9 1.3-4 1.3-5.3 0-1.2-.7-2.3-2-2.3-1.6 0-2.9 1.7-2.9 3.9 0 1.4.5 2.4.5 2.4S9.5 24 9.3 25.3c-.3 1.1-.4 2.4-.3 3.5-5.3-2.4-9-7.7-9-13.8C0 6.7 6.7 0 15 0s15 6.7 15 15-6.7 15-15 15z"></path></svg>
17
+ </symbol><symbol id="modules-close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><path d="M39.196 43.3L1.154 5.256l3.89-3.89 38.04 38.043z"></path><path d="M.54 39.413L38.58 1.37l3.89 3.89L4.428 43.302z"></path></svg></symbol></svg></div>
18
+ <header class="site-nav-container">
19
+
20
+ <div class="marketing-nav-wrapper">
21
+ <nav class="marketing-nav--skin-dark marketing-nav marketing-nav--primary" id="ShopifyMainNav" itemscope="itemscope" itemtype="https://schema.org/SiteNavigationElement" aria-label="Main Navigation">
22
+
23
+ <div class="marketing-nav__logo color-white">
24
+ <a href="{{ '/' | relative_url }}" class="marketing-nav__logo__shopify">
25
+ <svg class="icon" aria-labelledby="icon-shopify-developers-logo-5-title" role="img"><title id="icon-shopify-developers-logo-5-title">Home</title> <use xlink:href="#shopify-developers-logo"></use> </svg>
26
+ </a>
27
+ </div>
28
+ <span class="marketing-nav__items display--expanded-nav"></span>
29
+ </nav>
30
+ </div>
31
+ </header>
32
+
33
+ <div id="PageContainer">
34
+
35
+ <section class="section section--tight section-padding section--padding-top-only ui-hero">
36
+ <div class="grid">
37
+ <div class="grid__item">
38
+ <p class="section-heading__kicker heading--5 hide--mobile">Shopify Open Source</p>
39
+ <h1 class="section-heading__heading heading--2 ui-hero__header gutter-bottom--reset--mobile">Shopify App CLI</h1>
40
+ <p class="text-major hide--mobile ui-hero__header">
41
+ Build Shopify apps faster
42
+ </p>
43
+ </div>
44
+ </div>
45
+ </section>
46
+ <section id="Content">
47
+ <div class="grid">
48
+ <div class="grid__item grid__item--tablet-up-quarter" id="SidebarNav">
49
+ {% include sidebar_nav.html %}
50
+ </div>
51
+ <div class="grid__item grid__item--tablet-up-three-quarters sticky-menu-content">
52
+ <main role="main" id="Main">
53
+
54
+ <article>
55
+
56
+ <h1>{{ page.title }}</h1>
57
+
58
+ {% if page.toc %}
59
+ <h2 class="heading--4">On this page</h2>
60
+
61
+ <div class="on-this-page">
62
+ {% include toc.html html=content h_max=2 %}
63
+ </div>
64
+ {% endif %}
65
+
66
+ {{ content }}
67
+ </article>
68
+
69
+ </main>
70
+ </div>
71
+ </div>
72
+ </section>
73
+ </div>
74
+ </div>
75
+
76
+ {% include footer.html %}
77
+
78
+ </body>
79
+ </html>
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: Node.js app project command reference
3
+ section: node
4
+ ---
5
+
6
+ ## `deploy`
7
+
8
+ Deploy the current Node.js app to a hosting service. Currently, the only option is [Heroku](https://www.heroku.com).
9
+
10
+ ```console
11
+ $ shopify deploy heroku
12
+ ```
13
+
14
+ ## `generate`
15
+
16
+ Generate boilerplate code inside your app project. Node.js apps support generating new **pages**, **Billing API calls**, and **webhooks**.
17
+
18
+ ```console
19
+ $ shopify generate page
20
+ $ shopify generate billing
21
+ $ shopify generate webhook
22
+ ```
23
+
24
+ ## `open`
25
+
26
+ Open your local development app in your default browser.
27
+
28
+ ```console
29
+ $ shopify open
30
+ ```
31
+
32
+ ## `populate`
33
+
34
+ Add example data to your development store. This is useful for testing your app’s behavior. You can create the following types of example store records:
35
+
36
+ - Products
37
+ - Customers
38
+ - Orders
39
+
40
+ ```console
41
+ $ shopify populate products
42
+ $ shopify populate customers
43
+ $ shopify populate draftorders
44
+ ```
45
+
46
+ By default, the `populate` command adds 5 records. Use the `--count` option to specify a different number:
47
+
48
+ ```console
49
+ $ shopify populate products --count 10
50
+ ```
51
+
52
+ ## `serve`
53
+
54
+ Start a local development server for your project, as well as a public [ngrok](https://ngrok.com/) tunnel to your localhost.
55
+
56
+ ```console
57
+ $ shopify serve
58
+ ```
59
+
60
+ ## `tunnel`
61
+
62
+ Control an HTTP tunnel to your local development app using [ngrok](https://ngrok.com). With the `tunnel` command you can authenticate with ngrok and start or stop the tunnel. (Note that the `serve` command will automatically run `tunnel start` for you.)
63
+
64
+ To authenticate with ngrok, you need an authentication token. You can find it in [your ngrok dashboard](https://dashboard.ngrok.com/auth/your-authtoken). Copy your token and use it with the `tunnel auth` command:
65
+
66
+ ```console
67
+ $ shopify tunnel auth <token>
68
+ ```
69
+
70
+ This will write your ngrok auth token to `~/.ngrok2/ngrok.yml`. To learn more about ngrok configuration, [consult ngrok’s documentation](https://ngrok.com/docs#config).
71
+
72
+ To start an ngrok tunnel to your app in your localhost development environment:
73
+
74
+ ```console
75
+ $ shopify tunnel start
76
+ ```
77
+
78
+ To stop the running ngrok tunnel:
79
+
80
+ ```console
81
+ $ shopify tunnel stop
82
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: Getting started with Node.js app projects
3
+ section: node
4
+ toc: false
5
+ ---
6
+
7
+ ## Create a new Node.js app project
8
+
9
+ To create a new Node.js project, type `shopify create node`. This will scaffold a new Node.js app in a subdirectory.
10
+
11
+ ```console
12
+ $ shopify create node
13
+ ? App Name
14
+ >
15
+ ```
16
+
17
+ ## Start a local development server
18
+
19
+ Once your app is created, you can work with it immediately by running `shopify serve` to start a local development server. Shopify App CLI uses [ngrok](https://ngrok.com) to create a tunnel. ngrok will choose a unique URL for you. The server will stay open until you type **Ctrl-C**.
20
+
21
+ ```console
22
+ $ shopify serve
23
+ ✓ ngrok tunnel running at https://example.ngrok.io
24
+ ✓ writing .env file...
25
+ ```
26
+
27
+ ## Install your app on your development store
28
+
29
+ With the server running, open a new terminal window and run `shopify open` to open your app in your browser and install it on a development store.
30
+
31
+ ```console
32
+ $ shopify open
33
+ ```
34
+
35
+ For more information, consult the [Node.js project command reference]({{ site.baseurl }}{% link app/node/commands/index.md %}).
@@ -0,0 +1,80 @@
1
+ ---
2
+ title: Rails app project command reference
3
+ section: rails
4
+ ---
5
+
6
+ ## `deploy`
7
+
8
+ Deploy the current Rails project to a hosting service. Currently, the only option is [Heroku](https://www.heroku.com).
9
+
10
+ ```console
11
+ $ shopify deploy heroku
12
+ ```
13
+
14
+ ## `generate`
15
+
16
+ Generate boilerplate code inside your app project. Rails projects support generating new webhooks.
17
+
18
+ ```console
19
+ $ shopify generate webhook
20
+ ```
21
+
22
+ ## `open`
23
+
24
+ Open your local development app in your default browser.
25
+
26
+ ```console
27
+ $ shopify open
28
+ ```
29
+
30
+ ## `populate`
31
+
32
+ Add example data to your development store. This is useful for testing your app’s behavior. You can create the following types of example store records:
33
+
34
+ - Products
35
+ - Customers
36
+ - Orders
37
+
38
+ ```console
39
+ $ shopify populate products
40
+ $ shopify populate customers
41
+ $ shopify populate draftorders
42
+ ```
43
+
44
+ By default, the `populate` command adds 5 records. Use the `--count` option to specify a different number:
45
+
46
+ ```console
47
+ $ shopify populate products --count 10
48
+ ```
49
+
50
+ ## `serve`
51
+
52
+ Start a local development server for your project, as well as a public [ngrok](https://ngrok.com/) tunnel to your localhost.
53
+
54
+ ```console
55
+ $ shopify serve
56
+ ```
57
+
58
+ ## `tunnel`
59
+
60
+ Control an HTTP tunnel to your local development app using [ngrok](https://ngrok.com). With the `tunnel` command you can authenticate with ngrok and start or stop the tunnel. (Note that the `serve` command will automatically run `tunnel start` for you.)
61
+
62
+ To authenticate with ngrok, you need an authentication token. You can find it in [your ngrok dashboard](https://dashboard.ngrok.com/auth/your-authtoken). Copy your token and use it with the `tunnel auth` command:
63
+
64
+ ```console
65
+ $ shopify tunnel auth <token>
66
+ ```
67
+
68
+ This will write your ngrok auth token to `~/.ngrok2/ngrok.yml`. To learn more about ngrok configuration, [consult ngrok’s documentation](https://ngrok.com/docs#config).
69
+
70
+ To start an ngrok tunnel to your app in your localhost development environment:
71
+
72
+ ```console
73
+ $ shopify tunnel start
74
+ ```
75
+
76
+ To stop the running ngrok tunnel:
77
+
78
+ ```console
79
+ $ shopify tunnel stop
80
+ ```