diff --git a/Pipfile b/Pipfile new file mode 100644 index 000000000..71e4f7cbf --- /dev/null +++ b/Pipfile @@ -0,0 +1,11 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] + +[dev-packages] + +[requires] +python_version = "3.9" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 000000000..8aee7e8e0 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,20 @@ +{ + "_meta": { + "hash": { + "sha256": "a36a5392bb1e8bbc06bfaa0761e52593cf2d83b486696bf54667ba8da616c839" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.9" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": {}, + "develop": {} +} diff --git a/_sources/index.rst b/_sources/index.rst new file mode 100644 index 000000000..140294d92 --- /dev/null +++ b/_sources/index.rst @@ -0,0 +1,97 @@ +===================== +This Is A New Project +===================== + +.. Here is were you specify the content and order of your new book. + +.. Each section heading (e.g. "SECTION 1: A Random Section") will be + a heading in the table of contents. Source files that should be + generated and included in that section should be placed on individual + lines, with one line separating the first source filename and the + :maxdepth: line. + +.. Sources can also be included from subfolders of this directory. + (e.g. "DataStructures/queues.rst"). + +SECTION 1: Introduction +::::::::::::::::::::::: + +Congratulations! If you can see this file you have probably successfully run the ``runestone init`` command. If you are looking at this as a source file you should now run ``runestone build`` to generate html files. Once you have run the build command you can run ``runestone serve`` and then view this in your browser at ``http://localhost:8000`` + +This is just a sample of what you can do. The index.rst file is the table of contents for your entire project. You can put all of your writing in the index, or you can include additional rst files. Those files may even be in subdirectories that you can reference using a relative path. + + +:: + + + .. toctree:: + :maxdepth: 2 + + some/path/myfile.rst + + +Section 2: Links +:::::::::::::::: + +Runestone uses the ``restructuredText`` (rst) markup language. We chose this over markdown largely because rst is extensible. Nearly all of the basic markup tasks are already handled by restructuredText. You should check out the docs for the basics of restructuredText (link below). Our extensions are all for the interactive elements. One key hint about restructuredText: Its like **Python** -- *indentation matters!* + +* `restructuredText Docs `_ +* `Runestone Docs `_ +* Join the discussion on our `Google Group `_ +* Tell us about problems on `Github `_ + + + +SECTION 3: Sample Directives +:::::::::::::::::::::::::::: + +ActiveCode +---------- + +.. activecode:: codeexample1 + :coach: + :caption: This is a caption + + print("My first program adds a list of numbers") + myList = [2, 4, 6, 8, 10] + total = 0 + for num in myList: + total = total + num + print(total) + +Multiple Choice +--------------- + +.. mchoice:: question1_2 + :multiple_answers: + :correct: a,b,d + :answer_a: red + :answer_b: yellow + :answer_c: black + :answer_d: green + :feedback_a: Red is a definitely on of the colors. + :feedback_b: Yes, yellow is correct. + :feedback_c: Remember the acronym...ROY G BIV. B stands for blue. + :feedback_d: Yes, green is one of the colors. + + Which colors might be found in a rainbow? (choose all that are correct) + +These are just two of the many interactive components for writing online course materials. You can see examples of all of them `On our Example Page `_ + +Now feel free to modify this file to start creating your own interactive page. + + +Section 4: Theme +::::::::::::::::::: + +You can add your own CSS or JS files to every page of a book by modifying ``setup.custom_css_files`` or ``setup.custom_js_files`` in conf.py. + +If you want to do more significant changes to the theme, you should copy the files you wish to modify from +the runestone/common/project/template/sphinx_bootstrap to a directory like ``_templates/``. Then make sure +the ``templates_path`` points to them in your conf.py. + +conf.py: + +.. code:: + + templates_path = ["_templates"] \ No newline at end of file diff --git a/conf.py b/conf.py index 4ab699f14..42c757b61 100644 --- a/conf.py +++ b/conf.py @@ -1,6 +1,6 @@ -# ********* -# |docname| -# ********* +# ************************************************************* +# |docname| - Sphinx configuration file for a Runestone project +# ************************************************************* # # Problem Solving with Algorithms and Data Structures documentation build configuration file, created by # sphinx-quickstart on Thu Oct 27 08:17:45 2011. @@ -18,7 +18,7 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# sys.path.insert(0, os.path.abspath('../modules')) +#sys.path.insert(0, os.path.abspath('../modules')) from runestone import runestone_static_dirs, runestone_extensions, setup import pkg_resources @@ -26,113 +26,69 @@ # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -# needs_sphinx = '1.0' +#needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [ - "sphinx.ext.mathjax", - "myst_parser", - "sphinx.ext.intersphinx", -] + runestone_extensions() +extensions = ['sphinx.ext.mathjax'] + runestone_extensions() -# ,'runestone.video','runestone.reveal','runestone.poll','runestone.tabbedStuff','runestone.disqus','runestone.codelens','runestone.activecode', 'runestone.assess', 'runestone.animation','runestone.meta', 'runestone.parsons', 'runestone.blockly', 'runestone.livecode','runestone.accessibility'] - -# This sets up your project to use the defaults. If you want to create a custom set of templates -# for your own project you can over ride them by creating your own _templates folder -templates_path = [ - pkg_resources.resource_filename("runestone", "common/project_template/_templates") -] +#,'runestone.video','runestone.reveal','runestone.poll','runestone.tabbedStuff','runestone.disqus','runestone.codelens','runestone.activecode', 'runestone.assess', 'runestone.animation','runestone.meta', 'runestone.parsons', 'runestone.blockly', 'runestone.livecode','runestone.accessibility'] # The suffix of source filenames. -source_suffix = ".rst" +source_suffix = '.rst' # The encoding of source files. -# source_encoding = 'utf-8-sig' +#source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = "index" +master_doc = 'index' # General information about the project. -project = "Runestone Interactive Overview" -copyright = "2017 bjones" +project = 'Runestone Interactive Overview' +copyright = '2017 webster' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = "0.0.1" +version = '0.0.1' # The full version, including alpha/beta/rc tags. -release = "0.0" +release = '0.0' # The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# language = None +# for a list of supported languages. https://www.sphinx-doc.org/en/master/usage/configuration.html +language = "en" # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -# today = '' +#today = '' # Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' +#today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = [ - # Misc files. - ".pytest_cache", - # Ignore Runestone/Sphinx build output. - "build", - # Ignore copied files from test directories. - "**/test/build", - "**/_static", - "**/test/conf.py", - "**/test/pavement.py", - "**/test_error/build", - "**/test_error/conf.py", - "**/test_error/pavement.py", - "**/test_working/build", - "**/test_working/conf.py", - "**/test_working/pavement.py", - # Ignore the NPM library and webpack build output. - "node_modules", - "runestone/dist", - ".history/*", - # Ignore external JS libraries/CSS sheets. - "**/js/*_compressed.js", - "**/js/*.bundle.js", - "**/js/*.min.js", - "**/js/jquery*.js", - "**/js/md5.js", - "**/js/sharedb.js", - "**/js/skulpt*.js", - "**/jqchart", - "**/js/msg", - "**/js/processing.js", - "**/js/prettify.js", - "**/css/*.min.css", - "runestone/common/project_template/_templates/plugin_layouts/sphinx_bootstrap/static/bootstrap-*", -] +exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all documents. -default_role = "any" +#default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True +#add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -# add_module_names = True +#add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -# show_authors = False +#show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" +pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] +#modindex_common_prefix = [] # `keep_warnings `_: # If true, keep warnings as “system message” paragraphs in the built documents. @@ -144,13 +100,14 @@ # A string of reStructuredText that will be included at the beginning of every # source file that is read. rst_prolog = ( - # For fill-in-the-blank questions, provide a convenient means to indicate a blank. - """ +# For fill-in-the-blank questions, provide a convenient means to indicate a blank. +""" -.. |blank| replace:: :blank:`x` +.. |blank| replace:: :blank:`-` """ - # For literate programming files, provide a convenient way to refer to a source file's name. See `runestone.lp.lp._docname_role`. - """.. |docname| replace:: :docname:`name` + +# For literate programming files, provide a convenient way to refer to a source file's name. See `runestone.lp.lp._docname_role`. +""".. |docname| replace:: :docname:`name` """ ) @@ -172,18 +129,10 @@ # any file wihch matches the given `glob # `_. CodeChat_lexer_for_glob = { - # Otherwise, Pygments picks the wrong lexer for CSS and other common files. - "*.css": "CSS", - "*.js": "JavaScript", - "*.html": "HTML", - # Perl uses ``#`` for comments, so pretend these files are Perl. - "*.in": "Perl", - ".gitignore": "Perl", - "*.cfg": "INI", - # These are actually a Python files. - "codechat_config.json": "Python", - "conf.tmpl": "Python", - "pavement.tmpl": "Python", + # Otherwise, Pygments picks the wrong lexer for CSS... + '*.css': 'CSS', + # ... and for JavaScript. + '*.js': 'JavaScript', } # # **CodeChat note::** This is a list of exclude_patterns_ which applies only to @@ -201,22 +150,33 @@ # -- Options for HTML output --------------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "sphinx_bootstrap" +# The theme to use for HTML and HTML Help pages. sphinx_bootstrap is provided with +# Runestone. Other themes are built into sphinx: +# https://www.sphinx-doc.org/en/master/usage/theming.html?highlight=html_theme_path#using-a-theme +html_theme = 'sphinx_bootstrap' + +# If using a non-sphinx theme, the path to the theme folder must be in this list +html_theme_path = [pkg_resources.resource_filename('runestone', 'common/project_template/_templates/plugin_layouts')] + +# To override individual templates from the theme, you can make a directory and add its path +# relative to this file to the templates_path list. In it, place copies of any template files +# you wish to override - your template file(s) will be used instead of the default ones from the theme +#templates_path = ['_templates'] # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# html_theme_options = {'nosidebar': 'true'} html_theme_options = { # Navigation bar title. (Default: ``project`` value) - "navbar_title": "Runestone Components", + 'navbar_title': "Runestone Default", + # Tab name for entire site. (Default: "Site") - "navbar_site_name": "Chapters", + 'navbar_site_name': "Chapters", + # Global TOC depth for "site" navbar tab. (Default: 1) # Switching to -1 shows all levels. - "globaltoc_depth": 1, + 'globaltoc_depth': 1, + # Include hidden TOCs in Site navbar? # # Note: If this is "false", you cannot have mixed ``:hidden:`` and @@ -224,16 +184,20 @@ # will break. # # Values: "true" (default) or "false" - "globaltoc_includehidden": "true", + 'globaltoc_includehidden': "true", + # HTML navbar class (Default: "navbar") to attach to
element. # For black navbar, do "navbar navbar-inverse" - "navbar_class": "navbar", + 'navbar_class': "navbar", + # Fix navigation bar to top of page? # Values: "true" (default) or "false" - "navbar_fixed_top": "true", + 'navbar_fixed_top': "true", + # Location of link to source. # Options are "nav" (default), "footer" or anything else to exclude. - "source_link_position": "nav", + 'source_link_position': "nav", + # Bootswatch (http://bootswatch.com/) theme. # # Options are nothing with "" (default) or the name of a valid theme @@ -243,129 +207,107 @@ #'bootswatch_theme': "slate", } +# Additional templates that should be rendered to pages, maps page names to +# template names. +# https://www.sphinx-doc.org/en/master/usage/configuration.html?highlight=html_sidebars#confval-html_additional_pages +#html_additional_pages = {} + +# A list of paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +# Example: html_static_path = runestone_static_dirs() + ['_static', 'other'] +html_static_path = runestone_static_dirs() -# This is set up to use the default runestone themes, you can override them by -# creating your own folder and modifying this path. -# Add any paths that contain custom themes here, relative to this directory. -html_theme_path = [ - pkg_resources.resource_filename( - "runestone", "common/project_template/_templates/plugin_layouts" - ) -] +# List of extra stylesheets that should be added to all html pages +# Files must be on a path contained in html_static_path +#setup.custom_css_files = ["sample.css", "sample2.css"] +# List of extra js files that should be added to all html pages +# Items may be a file name or a dict with properties {"file":FILENAME, "key1", "value1", "key2, "value2"...} +# in which case file should have the file name and other key/value pairs are used as attrs +# on the script tag. The sample below will set sample2.js's script tag to have the defer attr +# Files must be on a path contained in html_static_path +#setup.custom_js_files = ["sample.css", {"file": "sample2.js", "defer": ""}] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -html_title = "Runestone Interactive Overview" +html_title = 'Runestone Interactive Overview' # A shorter title for the navigation bar. Default is the same as html_title. -html_short_title = "Runestone Interactive Overview" - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. +html_short_title ='Runestone Interactive Overview' -# logo is included in layout file -# html_logo = "../source/_static/logo_small.png" +# Logo is included at the top of the page +#html_logo = "../source/_static/logo_small.png" # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". - -html_static_path = runestone_static_dirs() +#html_favicon = None # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' +#html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} +#html_use_smartypants = True # If false, no module index is generated. -# html_domain_indices = True +#html_domain_indices = True # If false, no index is generated. -# html_use_index = True +#html_use_index = True # If true, the index is split into individual pages for each letter. -# html_split_index = False +#html_split_index = False # If true, links to the reST sources are added to the pages. html_show_sourcelink = False # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True +#html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True +#html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -# html_use_opensearch = '' +#html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None +#html_file_suffix = None # It True, sets js files from Sphinx & Runestone to be loaded with defer attr # substantially speeding up page rendering. May cause issues with books that # have custom directives or raw html that assume jquery or another library -# is loaded before body is parsed. +# is loaded before body is parsed. html_defer_js = True # Output file base name for HTML help builder. -htmlhelp_basename = "PythonCoursewareProjectdoc" +htmlhelp_basename = 'PythonCoursewareProjectdoc' -# 'accessibility_style' config value is defined in the 'accessibility' extension. +# .. _accessibility_style: +# +# accessibility_style +# ------------------- +# This config value is defined in the `../../accessibility/accessibility.py` extension. # By this config value you can select what accessibility stylesheet -# you want to add ('normal', 'light', 'darkest' or 'none') -# accessibility_style = 'normal' +# you want to add (``normal``, ``light``, ``darkest`` or ``none``). +#accessibility_style = 'normal' # Config values for specific Runestone components # -# activecode_div_class = 'runestone explainer ac_section alert alert-warning' -# activecode_hide_load_history = False -# mchoice_div_class = 'runestone alert alert-warning' -# clickable_div_class = 'runestone alert alert-warning' -# codelens_div_class = 'alert alert-warning cd_section' -# dragndrop_div_class = 'runestone' -# fitb_div_class = 'runestone' -# parsons_div_class = 'runestone' -# poll_div_class = 'alert alert-warning' -# shortanswer_div_class = 'journal alert alert-warning' -# shortanswer_optional_div_class = 'journal alert alert-success' -# showeval_div_class = 'runestone explainer alert alert-warning' -# tabbed_div_class = 'alert alert-warning' - -# Intersphinx -# =========== -# `intersphinx_mapping `_: -# This config value contains the locations and names of other projects that should be linked to in this documentation. -intersphinx_mapping = { - "RunestoneServer": ( - "https://runestoneserver.readthedocs.io/en/latest/", ( - None, - # An optional local file location -- useful when updating both Sphinx builds before the updates are pushed to the server. - ##"C:/Users/bjones/Documents/git/web2py/applications/runestone/_build/objects.inv", - ) - ), - "Overview": ( - "https://runestone.academy/runestone/books/published/overview/index.html", ( - None, - # An optional local file location -- useful when updating both Sphinx builds before the updates are pushed to the server. - ##"C:/Users/bjones/Documents/git/web2py/applications/runestone/books/overview/build/overview/objects.inv", - ) - ) -} +#activecode_div_class = 'runestone explainer ac_section alert alert-warning' +#activecode_hide_load_history = False +#mchoice_div_class = 'runestone alert alert-warning' +#clickable_div_class = 'runestone alert alert-warning' +#codelens_div_class = 'alert alert-warning cd_section' +#dragndrop_div_class = 'runestone' +#fitb_div_class = 'runestone' +#parsons_div_class = 'runestone' +#poll_div_class = 'alert alert-warning' +#shortanswer_div_class = 'journal alert alert-warning' +#shortanswer_optional_div_class = 'journal alert alert-success' +#showeval_div_class = 'runestone explainer alert alert-warning' +#tabbed_div_class = 'alert alert-warning' diff --git a/pavement.py b/pavement.py index 7dac75bcb..a6686b2e7 100644 --- a/pavement.py +++ b/pavement.py @@ -14,7 +14,7 @@ sys.path.append(os.getcwd()) # The project name, for use below. -project_name = 'RunestoneComponents' +project_name = 'testing' master_url = 'http://127.0.0.1:8000' if not master_url: @@ -30,7 +30,7 @@ build=Bunch( builddir=serving_dir, - sourcedir=".", + sourcedir="_sources", outdir=serving_dir, confdir=".", template_args={ @@ -40,9 +40,6 @@ 'python3': 'false', 'dburl': '', 'default_ac_lang': 'python', - 'jobe_server': 'http://jobe2.cosc.canterbury.ac.nz', - 'proxy_uri_runs': '/jobe/index.php/restapi/runs/', - 'proxy_uri_files': '/jobe/index.php/restapi/files/', 'downloads_enabled': 'false', 'enable_chatcodes': 'false', 'allow_pairs': 'false',