{"id":15141818,"url":"https://github.com/nativescript/docs-howto-extractor","last_synced_at":"2025-09-29T10:31:07.413Z","repository":{"id":141977609,"uuid":"54718203","full_name":"NativeScript/docs-howto-extractor","owner":"NativeScript","description":"A tool, extracting how-to articles from the NativeScript repo tests application","archived":true,"fork":false,"pushed_at":"2016-04-28T13:16:50.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-23T10:00:45.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NativeScript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-03-25T12:47:32.000Z","updated_at":"2023-10-04T07:46:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"79ef5a5d-9f5a-4602-9f3f-b3fd634617c1","html_url":"https://github.com/NativeScript/docs-howto-extractor","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"dce8bae747e674334e7e521b5e99bd73860e4322"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fdocs-howto-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fdocs-howto-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fdocs-howto-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fdocs-howto-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NativeScript","download_url":"https://codeload.github.com/NativeScript/docs-howto-extractor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219874490,"owners_count":16554583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-26T09:02:20.368Z","updated_at":"2025-09-29T10:31:07.141Z","avatar_url":"https://github.com/NativeScript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# SnippetsExtractor\n\nThis tool would extract snippets from source fiels.\n\n## How to Mark a Snippet\n\nYou need to follow these rules:\n - Create a fully-functional unit-test that would contain your snippet.\n - Start snippet with `// \u003csnippet module=\"\u003cmodule-relative-path\u003e\" title=\"\u003csnippet-title\u003e\" /\u003e`\n    (module is the relative path of the module. Based on this path, a HowTo.md file\n    will be generated. Title is the string, used to display the link in the generated\n    documentation Table of Contents as well as the Description of the generated HTML file,\n    read by the Search Engines.\n - Write md tags and comments by placing comment in the code file with // at the beginning.\n - You must wrap the code within md tags that would indicate it is actually a code.\n    + Start with: // ``` JavaScript\n    + To output a comment here start with ////, two of them would be automatically removed.\n    + Hide asserts within `// \u003chide\u003e` and `// \u003c/hide\u003e`.\n    + End with: // ```\n - End with `// \u003c/snippet\u003e`\n\n### Example:\n``` JavaScript\nexports.testFolderRename = function (){\n    // \u003csnippet filepath=\"ui/button\" name=\"UI -\u003e Button\"\u003e\n    // ## Setting a variable\n    // This example shows how to initialize myVar to 15.\n    // ``` JavaScript\n    //// Setting myVar to 15.\n    var myVar = 15;\n    // \u003chide\u003e\n    console.assert(myVar == 15);\n    // \u003c/hide\u003e\n    // ```\n    // That's how you set a myVar to 15.\n    // \u003c/snippet\u003e\n}\n```\n\n**START OF SET-VAR.MD**\n## Setting a variable\nThis example shows how to initialize myVar to 15.\n``` JavaScript\n// Setting myVar to 15.\nvar myVar = 15;\n```\nThat's how you set a myVar to 15.\n\n**END OF SET-VAR.MD**\n\n## How Does it Work\nThe tool is node.js console application.\n\nWhen run it will clean up its destination folder from md files.\nThen scan the source filder for js files.\nEach js file will be searched for some special comments described below.\nWhen comments that mark a snippet are found the tool\nwould output an md in the destination folder.\n\nCheck the help.md for command line options.\n\n### Snippet tags\nSnippet are enclosed within the tags:\n``` JavaScript\n// \u003csnippet module=\"\u003cmodule-path\u003e\" title=\"\u003cmodule-title\u003e\"\u003e\n    // This appends to \u003cmodule-path\u003e/HOW-TO.md\n    var myVar;\n// \u003c/snippet\u003e\n```\nThe lines between these two tags are appended to a file\nwith the name in the opening tag.\n\n### Hide tags\nTo hide code, that should not show in the snippet, wrap it with:\n``` JavaScript\n// \u003chide\u003e\n// This comment and the assert below are ignored.\nconsole.assert(myvar == \"myvalue\");\n// \u003c/hide\u003e\n```\n\n### Comment Slashes\nWhen comments within snippets are found, two of the leading slashes will be removed.\n``` JavaScript\n// ## This is H2 header\n//// Setting myVar\nvar myVar = 15\n```\n\nWould output the md:\n``` JavaScript\n## This is H2 header\n// Setting myVar\nvar myVar = 15\n```\n\n### Leading whitespace\nUniform leading whitespace would be removed so the snippet text is left aligned.\nSo there is no problem to use identation in your code. However it must be\neiter tabs or spaces. Do not mix tabs and spaces within the same snippet.\n\n### Can not Handle Comments with /* and */","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fdocs-howto-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript%2Fdocs-howto-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fdocs-howto-extractor/lists"}