Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some minor bugs and update the docs #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# we1s-templates

Repository for WE1S workspace templates and documentation.
Repository for [WE1S Workspace](https://we1s.ucsb.edu/wp-content/uploads/S-2.pdf) templates and documentation.

This repository is organised as follows:

1. `dist`: The `.tar.gz` archives of the Workspace templates. Templates will normally be downloaded from the archive files in this folder.
2. `docs`: The built HTML for the Getting Started website. This site is viewable at [https://whatevery1says.github.io/we1s-templates/](https://whatevery1says.github.io/we1s-templates/).
2. `docs`: The built HTML for the [Getting Started website](https://whatevery1says.github.io/we1s-templates/).
3. `src`: The source files for both the Getting Started website (in the `docs` subfolder and the Workspace templates (in the `templates` subfolder). The documentation is generated with [Mkdocs](https://www.mkdocs.org/), using the content of `src/docs`. The built site is then transferred to the main `docs` folder for publication to GitHub pages.

To get started, install [Jupyter](https://jupyter.org/ "Project Jupyter | Home"), open `new_project.ipynb` and run it. More documentation is available at the Getting Started website.

## Template Information

- **Name:** WE1S Workspace Project Template
- **Version:** 0.1.9
- **Contributors:** Jeremy Douglass, Scott Kleinman, Lindsay Thomas
- **Date:** 2021-27-02

Binary file added __pycache__/template_package.cpython-310.pyc
Binary file not shown.
70 changes: 70 additions & 0 deletions create_template_archive.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Create Template Archive\n",
"\n",
"This notebook is used by the WE1S project to create new versions of template archives. Although by default new projects are created from the latest template archive file available on GitHub, users can also use this notebook to create custom templates.\n",
"\n",
"Templates are stored as `.tar.gz` archive files. This notebook generates an archive of a template folder by importing the `template_package.py` script. This script can also be run from the command line (see the documentation inside the script file).\n",
"\n",
"Configure the following variables before running:\n",
"\n",
"- `name`: The name of the template file you wish to create.\n",
"- `version`: The semantic versioning version number of the template.\n",
"- `author`: The name of the create of the template archive (not the author(s) of the templates).\n",
"- `template_source`: The path to the folder you wish to archive.\n",
"- `archive_file`: The name of the archive file you wish to create. The extension `.tar.gz` is optional for this setting.\n",
"\n",
"After `package.create_datapackage()` is run in the cell below, you can see the datapackage and README files by calling `package.datapackage.descriptor` and `package.readme`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Configuration\n",
"name = 'project_template-0.1.9'\n",
"version = '0.1.9'\n",
"author = ''\n",
"template_source = 'project_template'\n",
"archive_file = 'project_template-0.1.9'\n",
"\n",
"# Import the TemplatePackage class\n",
"from template_package import TemplatePackage\n",
"\n",
"# Create the package\n",
"package = TemplatePackage(name, version, author)\n",
"# Add a datapackage and README file\n",
"package.create_datapackage(template_source)\n",
"# Make the archive\n",
"package.make_archive(template_source, archive_file)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
73 changes: 59 additions & 14 deletions new_project.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"PROJECT_ROOT = '/home/jovyan/write/pub/tests'\n",
"PROJECT_ROOT = '/home'\n",
"PORT = '11111'\n",
"MONGODB_CLIENT = 'mongodb://mongo:27017'"
]
Expand All @@ -57,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -77,18 +77,18 @@
"\n",
"A new project is a single directory into which modules are copied from a project template. Project templates are `.tar.gz` archives which you can import to your project directory from a local folder or a url. If you are working in a server environment, the template zip file must be uploaded to the server and imported from the upload directory. Enter either a filepath or a url for the archive file for the `template_source` setting.\n",
"\n",
"To use the latest template, configure `template_source='latest'`. This will download the most recent <a href=\"https://github.com/whatevery1says/project_templates/releases\" target=\"_blank\">release from GitHub</a>, so you must have an internet connection.\n",
"To use the latest template, configure `template_source='latest'`. This will download the most recent <a href=\"https://github.com/whatevery1says/we1s-templates/releases\" target=\"_blank\">release from GitHub</a>, so you must have an internet connection.\n",
"\n",
"The `.tar.gz` file is no longer needed after it has been extracted, so by default it is removed from your project folder. If for some reason you want to keep the file, you can do so by setting `remove_package=False`. "
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"template_source = 'project_template-0.1.9.tar.gz'\n",
"template_source = 'dist/latest/project_template-0.1.9.tar.gz'\n",
"remove_package = True"
]
},
Expand All @@ -104,9 +104,41 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Template archive extracted.\n"
]
},
{
"data": {
"text/html": [
"<h4>Your project called 20230614_1548_test was created successfully.</h4>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<p>Go to your project directory at <a href=\"/home/20230614_1548_test\" target=\"top\">/home/20230614_1548_test</a> (please make a note of the url).</p>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Python Imports\n",
"import json\n",
Expand All @@ -127,7 +159,7 @@
"now = datetime.today()\n",
"created = now.strftime('%Y-%m-%d %H:%M:%S')\n",
"project_full_name = now.strftime('%Y%m%d_%H%M_') + project_name\n",
"project_dir = PROJECT_ROOT + '/' + project_full_name\n",
"project_dir = os.path.join(PROJECT_ROOT, project_full_name)\n",
"if isinstance(contributors, list):\n",
" contributors = ', '.join(contributors)\n",
"\n",
Expand Down Expand Up @@ -219,15 +251,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<p style=\"color:green;\">Project deleted.</p>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Configure the path to the project folder.\n",
"# By default, it is based on the configurations above -- you may need to re-run the first cell.\n",
"\n",
"PROJECT_ROOT = '/home/jovyan/write/pub/tests'\n",
"project_dir = PROJECT_ROOT + '/' + project_full_name\n",
"PROJECT_ROOT = '/home'\n",
"project_dir = os.path.join(PROJECT_ROOT, project_full_name)\n",
"delete = False\n",
"\n",
"if delete:\n",
Expand Down Expand Up @@ -257,7 +302,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions src/docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

The WE1S Workspace is a containerized environment for importing, managing, and analyzing textual data using a variety of built-in analysis and visualization tools. It is designed to be well-documented and easy to use, but extendible, code-based environment. In the WE1S Workspace, users interact with their data inside a project created from a template.
The WE1S Workspace is a containerized environment for importing, managing, and analyzing textual data using a variety of built-in analysis and visualization tools. It is designed to be well-documented and easy to use, but extendible, code-based environment. In the WE1S Workspace, users interact with their data inside a project created from a template. The latest version of the template can be downloaded from [its Github repo](https://github.com/whatevery1says/we1s-templates).

!!! info "Version Compatibility"
This documentation is compatible with v{{ config.workspace_version }} of the WE1S Workspace and v{{ config.template_version }} of the WE1S <span class="no-gloss">project</span> template.
Expand All @@ -14,4 +14,4 @@ This website is designed to get you up and running once you have installed the W

For more information about the WhatEvery1Says (WE1S) Project can be found on the WE1S website: <a href="https://we1s.ucsb.edu/" target="_blank">https://we1s.ucsb.edu/</a>.

Last update: 2021-03-07
Last update: 2023-06-14
8 changes: 5 additions & 3 deletions src/docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ extra_javascript:
- javascripts/mark.es6.min.js
- javascripts/extra.js
copyright: Copyright &copy; 2021- <a href="https://we1s.ucsb.edu" target="_blank">WE1S Project</a>
repo_url: https://github.com/whatevery1says
repo_url: https://github.com/whatevery1says/we1s-templates
extra:
social:
- icon: fontawesome/solid/globe
link: https://we1s.ucsb.edu
- icon: fontawesome/brands/twitter
link: https://twitter.com/WE1Sproject
- icon: fontawesome/brands/github
link: https://github.com/whatevery1says
- icon: fontawesome/brands/twitter
link: https://twitter.com/WE1Sproject
- icon: fontawesome/brands/facebook
link: https://www.facebook.com/WhatEvery1Says/
plugins:
- search
- macros
Expand Down
618 changes: 618 additions & 0 deletions src/docs/site/404.html

Large diffs are not rendered by default.

637 changes: 637 additions & 0 deletions src/docs/site/about/index.html

Large diffs are not rendered by default.

Binary file added src/docs/site/assets/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading