{ "info": { "author": "Artemy Lomov", "author_email": "artemy@lomov.ru", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Documentation", "Topic :: Utilities" ], "description": "# Subset\n\nThis CLI extension adds the command `subset` that generates a config file for a subset (i.e. a detached part) of the Foliant project. The command uses:\n\n* the common (i.e. default, single) config file for the whole Foliant project;\n* the part of config that is individual for each subset. The Foliant project may include multiple subsets that are defined by their own partial config files.\n\nThe command `subset` takes a path to the subset directory as a mandatory command line parameter.\n\nThe command `subset`:\n\n* reads the partial config of the subset;\n* optionally rewrites the paths of Markdown files that specified there in the `chapters` section;\n* merges the result with the default config of the whole Foliant project config;\n* finally, writes a new config file that allows to build a certain subset of the Foliant project with the `make` command.\n\n## Installation\n\nTo install the extension, use the command:\n\n```bash\n$ pip install foliantcontrib.subset\n```\n\n## Usage\n\nTo get the list of all necessary parameters and available options, run `foliant subset --help`:\n\n```bash\n$ foliant subset --help\nusage: foliant subset [-h] [-p PROJECT_DIR_PATH] [-c CONFIG] [-n] [-d] SUBPATH\n\nGenerate the config file to build the project subset from SUBPATH.\n\npositional arguments:\n SUBPATH Path to the subset of the Foliant project\n\noptional arguments:\n -h, --help show this help message and exit\n -p PROJECT_DIR, --path PROJECT_DIR\n Path to the Foliant project\n -c CONFIG, --config CONFIG\n Name of config file of the Foliant project, default 'foliant.yml'\n -n, --norewrite Do not rewrite the paths of Markdown files in the subset partial config\n -d, --debug Log all events during build. If not set, only warnings and errors are logged\n```\n\nIn most cases it\u2019s enough to use the default values of optional parameters. You need to specify only the `SUBPATH`\u2014the directory that should be located inside the Foliant project source directory.\n\nSuppose you use the default settings. Then you have to prepare:\n\n* the common (default) config file `foliant.yml` in the Foliant project root directory;\n* partial config files for each subset. They also must be named `foliant.yml`, and they must be located in the directories of the subsets.\n\nYour Foliant project tree may look so:\n\n```bash\n$ tree\n.\n\u251c\u2500\u2500 foliant.yml\n\u2514\u2500\u2500 src\n \u251c\u2500\u2500 group_1\n \u2502 \u251c\u2500\u2500 product_1\n \u2502 \u2502 \u2514\u2500\u2500 feature_1\n \u2502 \u2502 \u251c\u2500\u2500 foliant.yml\n \u2502 \u2502 \u2514\u2500\u2500 index.md\n \u2502 \u2514\u2500\u2500 product_2\n \u2502 \u251c\u2500\u2500 foliant.yml\n \u2502 \u2514\u2500\u2500 main.md\n \u2514\u2500\u2500 group_2\n \u251c\u2500\u2500 foliant.yml\n \u2514\u2500\u2500 intro.md\n```\n\nThe command `foliant subset group_1/product_1/feautre_1` will merge the files `./src/group_1/product_1/feautre_1/foliant.yml` and `./foliant.yml`, and write the result into the file `./foliant.yml.subset`.\n\nAfter that you may use the command like the following to build your Foliant project:\n\n```bash\n$ foliant make pdf --config foliant.yml.subset\n```\n\nLet\u2019s look at some examples.\n\nThe content of the common (default) file `./foliant.yml`:\n\n```yaml\ntitle: &title Default Title\n\nsubtitle: &subtitle Default Subtitle\n\nversion: &version 0.0\n\nbackend_config:\n pandoc:\n template: !path /somewhere/template.tex\n reference_docx: !path /somewhere/reference.docx\n vars:\n title: *title\n version: *version\n subtitle: *subtitle\n year: 2018\n params:\n pdf_engine: xelatex\n```\n\nThe content of the partial config file `./src/group_1/product_1/feautre_1/foliant.yml`:\n\n```yaml\ntitle: &title Group 1, Product 1, Feature 1\n\nsubtitle: &subtitle Technical Specification\n\nversion: &version 1.0\n\nchapters:\n - index.md\n\nbackend_config:\n pandoc:\n vars:\n year: 2019\n```\n\n\nThe content of newly generated file `./foliant.yml.subset`:\n\n```yaml\ntitle: &title Group 1, Product 1, Feature 1\nsubtitle: &subtitle Technical Specification\nversion: &version 1.0\nbackend_config:\n pandoc:\n template: !path /somewhere/template.tex\n reference_docx: !path /somewhere/reference.docx\n vars:\n title: *title\n version: *version\n subtitle: *subtitle\n year: 2019\n params:\n pdf_engine: xelatex\nchapters:\n- b2b/order_1/feature_1/index.md\n```\n\nIf the option `--no-rewrite` is not set, the paths of Markdown files that are specified in the `chapters` section of the file `./src/group_1/product_1/feautre_1/foliant.yml`, will be rewritten as if these paths were relative to the directory `./src/group_1/product_1/feautre_1/`.\n\nOtherwise, the Subset CLI extension will not rewrite the paths of Markdown files as if they were relative to `./src/` directory.\n\nNote that the Subset CLI Extension merges the data of the config files recursively, so any subkeys of default config may be overridden by the settings of partial config.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/foliant-docs/foliantcontrib.subset", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "foliantcontrib.subset", "package_url": "https://pypi.org/project/foliantcontrib.subset/", "platform": "any", "project_url": "https://pypi.org/project/foliantcontrib.subset/", "project_urls": { "Homepage": "https://github.com/foliant-docs/foliantcontrib.subset" }, "release_url": "https://pypi.org/project/foliantcontrib.subset/1.0.9/", "requires_dist": [ "foliant (>=1.0.5)", "oyaml" ], "requires_python": "", "summary": "Extension for Foliant documentation generator to build subset of Foliant projects.", "version": "1.0.9" }, "last_serial": 5976695, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "7cf580112d8c7793fece76a779ea56d0", "sha256": "9b0f87d7d0bfa43cd817f332df68c57afbd85342bbe0890718b4cf3f698bf4e9" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.0.tar.gz", "has_sig": false, "md5_digest": "7cf580112d8c7793fece76a779ea56d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4721, "upload_time": "2018-10-18T16:06:30", "url": "https://files.pythonhosted.org/packages/cf/8c/266f691daf855ec6651b20e89bfd9594772fbfb2927f52a0af61c4f5402b/foliantcontrib.subset-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "294d7d6fb01a2bd51863c86e9492fe50", "sha256": "2bfe7d5d81973e4fe6eab144063babd55c777355999f22132b6e5089c852a501" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.1.tar.gz", "has_sig": false, "md5_digest": "294d7d6fb01a2bd51863c86e9492fe50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5278, "upload_time": "2018-10-22T15:23:52", "url": "https://files.pythonhosted.org/packages/39/89/a6ed47805382c1d25f54cc01c6e8414b3e11b20f899e36e6ec4404b78d54/foliantcontrib.subset-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "e8918675d6d2891733b180d982915a9d", "sha256": "95f8f784910181fc1b2eb9c0b9f2e4911e24544fd75d957355c20ff1f9343b50" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e8918675d6d2891733b180d982915a9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5273, "upload_time": "2018-10-23T14:31:10", "url": "https://files.pythonhosted.org/packages/04/b8/6d008a924a4e69df5103cdcfbe813f29db552ebfa819aa90ed21339385f5/foliantcontrib.subset-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "76514aeabd4c01068ed774cb54c36d0b", "sha256": "9314a9e1ff083c09869202f146e4e59d0a7d3965a9fc34c4b570de03535f0b7a" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.3.tar.gz", "has_sig": false, "md5_digest": "76514aeabd4c01068ed774cb54c36d0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5285, "upload_time": "2018-10-23T15:28:17", "url": "https://files.pythonhosted.org/packages/76/8c/44f6a711775f3112eecb11e34e60e1c620e212fe71aacb87fbf9baeb13b8/foliantcontrib.subset-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "0bf12b25284e9bc7c7584f9974ae43b6", "sha256": "4d126f1565e243bb1302f6136a233a154bb5d5f978e451c1cf81c9fd4f6477c6" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.4.tar.gz", "has_sig": false, "md5_digest": "0bf12b25284e9bc7c7584f9974ae43b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5285, "upload_time": "2018-10-23T16:22:14", "url": "https://files.pythonhosted.org/packages/04/5d/030d3550fe59dece13ad6c48a864fcf622aec308a48ba27eb3df8f4e69ea/foliantcontrib.subset-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "8a9c2f1bbc47a46f05ba27f41e853ebe", "sha256": "9cb88a48fbc1a3beaa59fce8b42eaf22e0d4da7f69d27c6f6ec435e866162093" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.5.tar.gz", "has_sig": false, "md5_digest": "8a9c2f1bbc47a46f05ba27f41e853ebe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5285, "upload_time": "2018-11-09T13:12:15", "url": "https://files.pythonhosted.org/packages/9b/ae/ad18bb415ddbec47d349f2f6f52cde0d9995d12ad0347ffb035e59eee5ce/foliantcontrib.subset-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "fcd0b91908e9b25057698b316ae150cc", "sha256": "f096d21524c12b9fccbeaa332ebf49013b0a4c910731254f2c190977eae6aefa" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.6.tar.gz", "has_sig": false, "md5_digest": "fcd0b91908e9b25057698b316ae150cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5297, "upload_time": "2018-12-04T13:38:40", "url": "https://files.pythonhosted.org/packages/69/51/f2f1601c51c408a64d27d314922b0cad2ebbba0cc0168f037d6416ec5fd4/foliantcontrib.subset-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "c7342c99d32e2f837f99d1f618e1ecd4", "sha256": "71ca885f601017fb56649b4a7a555baa2c8b8a0dd930a5cb2273391002252f92" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.7.tar.gz", "has_sig": false, "md5_digest": "c7342c99d32e2f837f99d1f618e1ecd4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5314, "upload_time": "2018-12-06T16:30:28", "url": "https://files.pythonhosted.org/packages/a1/67/a4343237cb6bd34c5ebe66f183ef7604a47a1880dec7939757c0ed011372/foliantcontrib.subset-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "aaf5784c0c6d55bd4d97d3f7cac93ce0", "sha256": "3786ae7777e9d8ff32a7ac96eee60c5591922c3e3aefc6aa417e11556c35f576" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.8.tar.gz", "has_sig": false, "md5_digest": "aaf5784c0c6d55bd4d97d3f7cac93ce0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5310, "upload_time": "2018-12-06T16:39:04", "url": "https://files.pythonhosted.org/packages/72/d4/04f7ffa500a8c195587311d711ccaa44cc014f06f6acbe80ab425a9e08db/foliantcontrib.subset-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "3072c84684869c738f5f32eb887defa7", "sha256": "b2297f0085e13624c3f66d18f91a330d062d2be884a080176c8484e646d48f1e" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "3072c84684869c738f5f32eb887defa7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6174, "upload_time": "2019-10-15T12:34:15", "url": "https://files.pythonhosted.org/packages/8d/92/e7f6f83a47f8d142df4e7aa92542e32ef4978bae3b7ba380e0efbb270117/foliantcontrib.subset-1.0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04c5b9bf44c9038cdc9b1ee77ec072fd", "sha256": "f4ee4e4bb085ca4dacfb8d752d9a751aef782f714e9c339582c384b5e6d61559" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.9.tar.gz", "has_sig": false, "md5_digest": "04c5b9bf44c9038cdc9b1ee77ec072fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5336, "upload_time": "2019-10-15T12:34:17", "url": "https://files.pythonhosted.org/packages/e1/38/03fa7c93bd32d955262f4caf6e017b34992263909c1a857a22d8e0f5dca8/foliantcontrib.subset-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3072c84684869c738f5f32eb887defa7", "sha256": "b2297f0085e13624c3f66d18f91a330d062d2be884a080176c8484e646d48f1e" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "3072c84684869c738f5f32eb887defa7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6174, "upload_time": "2019-10-15T12:34:15", "url": "https://files.pythonhosted.org/packages/8d/92/e7f6f83a47f8d142df4e7aa92542e32ef4978bae3b7ba380e0efbb270117/foliantcontrib.subset-1.0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04c5b9bf44c9038cdc9b1ee77ec072fd", "sha256": "f4ee4e4bb085ca4dacfb8d752d9a751aef782f714e9c339582c384b5e6d61559" }, "downloads": -1, "filename": "foliantcontrib.subset-1.0.9.tar.gz", "has_sig": false, "md5_digest": "04c5b9bf44c9038cdc9b1ee77ec072fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5336, "upload_time": "2019-10-15T12:34:17", "url": "https://files.pythonhosted.org/packages/e1/38/03fa7c93bd32d955262f4caf6e017b34992263909c1a857a22d8e0f5dca8/foliantcontrib.subset-1.0.9.tar.gz" } ] }