From ce18658c8f24ddba025c160bb31dc757aced4c3e Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 4 Apr 2018 11:32:44 +0200 Subject: [PATCH 1/2] Add a guides index generator Run generator with ./list.rb > index.md --- guides/list.rb | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 guides/list.rb diff --git a/guides/list.rb b/guides/list.rb new file mode 100755 index 00000000000..9e76010d0c4 --- /dev/null +++ b/guides/list.rb @@ -0,0 +1,43 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require 'active_support/core_ext/string/inflections' + +# Generates a new guides index +# +# Usage +# +# ./index.rb > index.md +# +def generate_index(files) + current_dir = nil + + puts "# Solidus Guides" + puts "" + + files.each do |file| + next unless File.file?(file) + file_path = file.sub(/^\.\//, '') + dir_name = nicify(File.dirname(file)) + file_name = nicify(File.basename(file)) + new_dir = current_dir != dir_name + if new_dir && !current_dir + puts "## #{dir_name}" + elsif current_dir && new_dir + puts "" + puts "## #{dir_name}" + end + puts " - [#{file_name}](#{file_path})" + current_dir = dir_name + end +end + +def nicify(name) + name.sub(/^\.\//, '').tr('-', ' ').sub(/\.md$/, '').titleize +end + +files = Dir.glob("**/*").sort.reject do |file| + File.basename(file) == File.basename(__FILE__) || File.basename(file) == 'index.md' +end + +generate_index(files) From ac0c23ce9af7cf4c098646320a13d86509928e64 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 4 Apr 2018 11:18:04 +0200 Subject: [PATCH 2/2] Generate guides index file --- guides/index.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 guides/index.md diff --git a/guides/index.md b/guides/index.md new file mode 100644 index 00000000000..78309068b78 --- /dev/null +++ b/guides/index.md @@ -0,0 +1,88 @@ +# Solidus Guides + +## Adjustments + - [Overview](adjustments/overview.md) + +## Assets + - [Asset Management](assets/asset-management.md) + - [Override Solidus Assets](assets/override-solidus-assets.md) + +## Extensions + - [Decorators](extensions/decorators.md) + - [Installing Extensions](extensions/installing-extensions.md) + - [Testing Extensions](extensions/testing-extensions.md) + +## Getting Started + - [Develop Solidus](getting-started/develop-solidus.md) + - [First Time Installation](getting-started/first-time-installation.md) + - [Forking Solidus](getting-started/forking-solidus.md) + - [Installation Options](getting-started/installation-options.md) + +## Inventory + - [Inventory Units](inventory/inventory-units.md) + - [Overview](inventory/overview.md) + - [Stock Items](inventory/stock-items.md) + - [Stock Movements](inventory/stock-movements.md) + +## Locations + - [Countries And States](locations/countries-and-states.md) + - [Zones](locations/zones.md) + +## Orders + - [Display Total Methods](orders/display-total-methods.md) + - [Order State Machine](orders/order-state-machine.md) + - [Overview](orders/overview.md) + - [Update Orders](orders/update-orders.md) + +## Payments + - [Custom Gateway](payments/custom_gateway.md) + - [Overview](payments/overview.md) + - [Payment Method](payments/payment_method.md) + - [Payment Processing](payments/payment_processing.md) + +## Preferences + - [Add Model Preferences](preferences/add-model-preferences.md) + - [App Configuration](preferences/app-configuration.md) + - [Class Extension Points](preferences/class-extension-points.md) + +## Products And Variants + - [Multi Currency Support](products-and-variants/multi-currency-support.md) + - [Overview](products-and-variants/overview.md) + - [Product Images](products-and-variants/product-images.md) + - [Product Properties](products-and-variants/product-properties.md) + - [Products](products-and-variants/products.md) + - [Taxonomies And Taxons](products-and-variants/taxonomies-and-taxons.md) + - [Variants](products-and-variants/variants.md) + +## Promotions + - [Overview](promotions/overview.md) + - [Promotion Actions](promotions/promotion-actions.md) + - [Promotion Handlers](promotions/promotion-handlers.md) + - [Promotion Rules](promotions/promotion-rules.md) + +## Returns + - [Return Authorizations](returns/return-authorizations.md) + +## Shipments + - [Cartons](shipments/cartons.md) + - [Custom Shipping Calculators](shipments/custom-shipping-calculators.md) + - [Overview Of Shipments](shipments/overview-of-shipments.md) + - [Shipment Setup Examples](shipments/shipment-setup-examples.md) + - [Shipping Method Filters](shipments/shipping-method-filters.md) + - [Solidus Active Shipping Extension](shipments/solidus-active-shipping-extension.md) + - [Split Shipments](shipments/split-shipments.md) + - [User Interface For Shipments](shipments/user-interface-for-shipments.md) + +## Taxation + - [Custom Tax Calculator](taxation/custom-tax-calculator.md) + - [Displaying Prices](taxation/displaying-prices.md) + - [Example Tax Setups](taxation/example-tax-setups.md) + - [Overview Of Taxation](taxation/overview-of-taxation.md) + - [Value Added Tax](taxation/value-added-tax.md) + +## Users + - [Addresses](users/addresses.md) + +## Views + - [Custom Frontend](views/custom-frontend.md) + - [Override Views](views/override-views.md)