{"id":21070389,"url":"https://github.com/stencila/libtemplate","last_synced_at":"2025-03-14T02:41:51.128Z","repository":{"id":146684422,"uuid":"118988963","full_name":"stencila/libtemplate","owner":"stencila","description":":recycle: A template repository for creating https://stenci.la compatible function libraries","archived":false,"fork":false,"pushed_at":"2018-03-07T03:59:31.000Z","size":27,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T21:55:51.104Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stencila.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-26T01:27:16.000Z","updated_at":"2019-01-20T09:35:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c754abf-b71a-4f5f-bb25-f4cd44ea4b6c","html_url":"https://github.com/stencila/libtemplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stencila%2Flibtemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stencila%2Flibtemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stencila%2Flibtemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stencila%2Flibtemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stencila","download_url":"https://codeload.github.com/stencila/libtemplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243513477,"owners_count":20302953,"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-11-19T18:46:45.746Z","updated_at":"2025-03-14T02:41:51.095Z","avatar_url":"https://github.com/stencila.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# library-template\n\nThis repository is a template for creating [Stencila][stencila-site]-compatible libraries.\nWe recommend using this template to anyone who would like to create a library for making\ntheir functions for available in Stencila. You can think of this template as a part of Stencila API.\n\n1.  Please *do not fork this repository directly on GitHub.*\n    Instead, please use GitHub's importer following [the instructions below](#creating-your-repository).\n\n2.  Please *do your work in your repository's `master` branch*,\n    the documentation for your library will be \n    automatically published as a website by GitHub from the `docs` folder.\n\n3.  Once you are done, please also [let us know][contact] and send us the link to your \nlibrary repository so that we can register it with Stencila and make it available to \nresearchers worldwide!\n\n\n## Creating your repository\n\n1.  Log in to GitHub.\n    (If you do not have an account, you can quickly create one for free.)\n    You must be logged in for the remaining steps to work.\n\n2.  Go to [GitHub's importer][importer].\n\n3.  Paste the url of this repo as the old repository to clone:\n    \u003chttps://github.com/stencila/libtemplate\u003e.\n\n4.  Select the owner for your new repository.\n    (This will probably be you, but may instead be an organization you belong to.)\n\n5.  Choose a name for your library repository.\n    For example, `libgenomics`, `libecology` and so on.\n\n6.  Make sure the repository is public.\n\n7.   You can now click \"Begin Import\".\n    When the process is done,\n    you will receive a message like\n    \"Importing complete! Your new repository apawlik/libgenomics is ready.\"\n    and you can go to the new repository by clicking on the name.\n\n**Note:**\nsome people have had intermittent errors during the import process,\npossibly because of the network timing out.\nIf you experience a problem, please re-try;\nif the problem persists,\nplease [get in touch](#help).\n\n## Using the template\n\n**Adding your libraries directly via GitHub interface**\n\n1.  Go to your newly-created repository,\n    which will be at `https://github.com/\u003cyourusername\u003e/lib\u003cdomain\u003e`.\n    For example,\n    if your username is `apawlik`,\n    the repository's URL will be `https://github.com/apawlik/libgenomics`.\n\n2.  Have a look into the `funcs` subdirectory. It contains templates for\nfunctions in different languages (e.g. `hello.R`, `hello.py`, `hello.js` and so on).\nPick the template for the language your libraries are written in. Copy the contents of the template.\n\n3. In the top right click the button \"Create new file\". This will open the editor on your screen.\nPaste in the contents you copied from the template in. You need to give the file you created a name -\nyou will see the small text box at the top of the editor. Please provide a meaningful name such as:\n`pearson.R` or `extract_counts.py` (note that you need to provide the correct extension!).\n\n4. To write tests for your function, go to the `tests` subdirectory. It contains templates for\nfunction tests in different languages (`hello.R`, `hello.py`, `hello.js` and so on).\nPick the relevant template and copy its contents.\n\n5. In the top right click the button \"Create new file\". This will open the editor on your screen.\nPaste in the contents you copied from the test template in. You need to give the file you created a name -\nyou will see the small text box at the top of the editor.\n\n**Adding your libraries in local repository**\n\nIf you are already familiar with Git,\nyou can clone the repository to your desktop: \n\n```\n git clone https://github.com/your_username/lib-domain\n```\n\nwrite your functions and tests locally (using the templates - please see the details above),\nand push your changes back to the repository you imported.\n\n```\n git push origin master\n```\n    \n You can also create documentation automatically (in the `doc` folder) running the script on your machine.\n Please see the details below.\n\n\n## Generating documentation in the `doc` folder\n\n**Note**: In order to generate documentation, you will need to clone the repository on your local machine.\n\nIf you used the Documentation for your functions is generated automatically. You need to, however,\nfollow the templates provided and include documentation as per the examples in them.\nIn order to generate the documentation, you will need to run the [script](generate_doc.py)\nwhich is included in the template. This will generate documentation files in the `doc` directory,\nin [Markdown][markdown] format. \n\nOnce you generated the documentation, push the changes back to your repository. \n\nYou can preview your changes in your GitHub pages which would be: `https://your_username.github.io/lib-domain`\nIn the example above, this is `https://apawlik.github.io/lib-genomics`.\n\n\n## Help\n\nIf you find bugs in our instructions,\nor would like to suggest improvements,\nplease [file an issue][issues]\nor [mail us][contact].\n\n[contact]: mailto:hello@stenci.la\n[conduct]: https://github.com/stencila/policies/blob/master/CONDUCT.md\n[community-forum]: https://github.com/stencila/libcore/blob/master/docs/community.stenci.la\n[github]: http://github.com\n[importer]: https://github.com/new/import\n[issues]: https://help.github.com/articles/creating-an-issue/\n[how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github\n[stencila-site]: http://stenci.la/\n[stencila-repo]: https://github.com/stencila/stencila\n[stencila-twitter]: https://twitter.com/stencila\n[stencila-gitter]: https://gitter.im/stencila/stencila/\n[markdown]: https://daringfireball.net/projects/markdown\n[libcore-contribute]: https://github.com/stencila/libcore/blob/master/CONTRIBUTING.md\n[libraries-contribute]: computation/functions.md#domain-specific-libraries\n[new-functions]: computation/functions.md#adding-new-functions\n[node-contribute]: https://github.com/stencila/node/CONTRIBUTING.md\n[desktop-contribute]: https://github.com/stencila/desktop/blob/master/CONTRIBUTING.md\n[cli-contribute]: https://github.com/stencila/cli/CONTRIBUTING.md\n[hub-contribute]: https://github.com/stencila/hub/CONTRIBUTING.md\n[cloud-contribute]: https://github.com/stencila/cloud/CONTRIBUTING.md\n[images-contribute]: https://github.com/stencila/images/CONTRIBUTING.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstencila%2Flibtemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstencila%2Flibtemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstencila%2Flibtemplate/lists"}