1.1.1.2.1.1. nikola.plugins.command package — Nikola 8.1.3 documentation

# 1.1.1.2.1.1. nikola.plugins.command package

Commands for Nikola.

## 1.1.1.2.1.1.1. Subpackages

- 1.1.1.2.1.1.1.1. nikola.plugins.command.auto package
- 1.1.1.2.1.1.1.2. nikola.plugins.command.rst2html package

## 1.1.1.2.1.1.2. Submodules

## 1.1.1.2.1.1.3. nikola.plugins.command.check module

Check the generated site.

class nikola.plugins.command.check.CommandCheck(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Check the generated site.

  analyze(fname, find_sources=False, check_remote=False)

    Analyze links on a page.

  cache = {}
  checked_remote_targets = {}
  clean_files()

    Remove orphaned files.

  cmd_options = [{'name': 'links', 'short': 'l', 'long': 'check-links', 'type': <class 'bool'>, 'default': False, 'help': 'Check for dangling links'}, {'name': 'files', 'short': 'f', 'long': 'check-files', 'type': <class 'bool'>, 'default': False, 'help': 'Check for unknown (orphaned and not generated) files'}, {'name': 'clean', 'long': 'clean-files', 'type': <class 'bool'>, 'default': False, 'help': 'Remove all unknown files, use with caution'}, {'name': 'find_sources', 'long': 'find-sources', 'type': <class 'bool'>, 'default': False, 'help': 'List possible source files for files with broken links.'}, {'name': 'verbose', 'long': 'verbose', 'short': 'v', 'type': <class 'bool'>, 'default': False, 'help': 'Be more verbose.'}, {'name': 'remote', 'long': 'remote', 'short': 'r', 'type': <class 'bool'>, 'default': False, 'help': 'Check that remote links work.'}]
  doc_purpose = 'check links and files in the generated site'
  doc_usage = '[-v] (-l [--find-sources] [-r] | -f [--clean-files])'
  existing_targets = {}
  name = 'check'
  scan_files()

    Check files in the site, find missing and orphaned files.

  scan_links(find_sources=False, check_remote=False)

    Check links on the site.

nikola.plugins.command.check.fs_relpath_from_url_path(url_path)

  Create a filesystem relative path from an URL path.

nikola.plugins.command.check.real_scan_files(site, cache=None)

  Scan for files.

## 1.1.1.2.1.1.4. nikola.plugins.command.console module

Start debugging console.

class nikola.plugins.command.console.CommandConsole(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Start debugging console.

  bpython(willful=True)

    Run a bpython shell.

  cmd_options = [{'name': 'bpython', 'short': 'b', 'long': 'bpython', 'type': <class 'bool'>, 'default': False, 'help': 'Use bpython'}, {'name': 'ipython', 'short': 'i', 'long': 'plain', 'type': <class 'bool'>, 'default': False, 'help': 'Use IPython'}, {'name': 'plain', 'short': 'p', 'long': 'plain', 'type': <class 'bool'>, 'default': False, 'help': 'Use the plain Python interpreter'}, {'name': 'command', 'short': 'c', 'long': 'command', 'type': <class 'str'>, 'default': None, 'help': 'Run a single command'}, {'name': 'script', 'short': 's', 'long': 'script', 'type': <class 'str'>, 'default': None, 'help': 'Execute a python script in the console context'}]
  doc_description = 'The site engine is accessible as `site` and `nikola_site`, the config file as `conf`, and commands are available as `commands`.\nIf there is no console to use specified (as -b, -i, -p) it tries IPython, then falls back to bpython, and finally falls back to the plain Python console.'
  doc_purpose = 'start an interactive Python console with access to your site'
  header = 'Nikola v8.1.3 -- {0} Console (conf = configuration file, site, nikola_site = site engine, commands = nikola commands)'
  ipython(willful=True)

    Run an IPython shell.

  name = 'console'
  plain(willful=True)

    Run a plain Python shell.

  shells = ['ipython', 'bpython', 'plain']

## 1.1.1.2.1.1.5. nikola.plugins.command.default_config module

Show the default configuration.

class nikola.plugins.command.default_config.CommandShowConfig(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Show the default configuration.

  cmd_options = []
  doc_purpose = 'Print the default Nikola configuration.'
  doc_usage = ''
  name = 'default_config'
  needs_config = False

## 1.1.1.2.1.1.6. nikola.plugins.command.deploy module

Deploy site.

class nikola.plugins.command.deploy.CommandDeploy(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Deploy site.

  doc_description = 'Deploy the site by executing deploy commands from the presets listed on the command line. If no presets are specified, `default` is executed.'
  doc_purpose = 'deploy the site'
  doc_usage = '[preset [preset...]]'
  name = 'deploy'

## 1.1.1.2.1.1.7. nikola.plugins.command.github_deploy module

Deploy site to GitHub Pages.

class nikola.plugins.command.github_deploy.CommandGitHubDeploy(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Deploy site to GitHub Pages.

  cmd_options = [{'name': 'commit_message', 'short': 'm', 'long': 'message', 'default': 'Nikola auto commit.', 'type': <class 'str'>, 'help': 'Commit message'}]
  doc_description = 'This command can be used to deploy your site to GitHub Pages. It uses ghp-import to do this task. It also optionally commits to the source branch.\n\nConfiguration help: https://getnikola.com/handbook.html#deploying-to-github'
  doc_purpose = 'deploy the site to GitHub Pages'
  doc_usage = '[-m COMMIT_MESSAGE]'
  name = 'github_deploy'

exception nikola.plugins.command.github_deploy.DeployFailedException

  Bases: :class:`Exception`

  An internal exception for deployment errors.

nikola.plugins.command.github_deploy.check_ghp_import_installed()

  Check if ghp-import is installed.

nikola.plugins.command.github_deploy.uni_check_output(*args, **kwargs)

  Run command and return output as Unicode (UTf-8).

## 1.1.1.2.1.1.8. nikola.plugins.command.import_wordpress module

Import a WordPress dump.

class nikola.plugins.command.import_wordpress.CommandImportWordpress(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`, :class:`nikola.plugins.basic_import.ImportMixin`

  Import a WordPress dump.

  all_tags = {}
  cmd_options = [{'name': 'output_folder', 'long': 'output-folder', 'short': 'o', 'default': 'new_site', 'help': 'Location to write imported content.'}, {'name': 'exclude_drafts', 'long': 'no-drafts', 'short': 'd', 'default': False, 'type': <class 'bool'>, 'help': "Don't import drafts"}, {'name': 'exclude_privates', 'long': 'exclude-privates', 'default': False, 'type': <class 'bool'>, 'help': "Don't import private posts"}, {'name': 'include_empty_items', 'long': 'include-empty-items', 'default': False, 'type': <class 'bool'>, 'help': 'Include empty posts and pages'}, {'name': 'squash_newlines', 'long': 'squash-newlines', 'default': False, 'type': <class 'bool'>, 'help': 'Shorten multiple newlines in a row to only two newlines'}, {'name': 'no_downloads', 'long': 'no-downloads', 'default': False, 'type': <class 'bool'>, 'help': 'Do not try to download files for the import'}, {'name': 'download_auth', 'long': 'download-auth', 'default': None, 'type': <class 'str'>, 'help': "Specify username and password for HTTP authentication (separated by ':')"}, {'name': 'separate_qtranslate_content', 'long': 'qtranslate', 'default': False, 'type': <class 'bool'>, 'help': "Look for translations generated by qtranslate plugin.\nWARNING: a default wordpress export won't allow to recover title translations.\nFor this to be possible consider applying the hack suggested at\nhttps://github.com/qtranslate/qtranslate-xt/issues/199 :\n\nIn wp-admin/includes/export.php change\n`echo apply_filters( 'the_title_rss', $post->post_title );\n\nto\n`echo apply_filters( 'the_title_export', $post->post_title );\n"}, {'name': 'translations_pattern', 'long': 'translations_pattern', 'default': '{path}.{lang}.{ext}', 'type': <class 'str'>, 'help': 'The pattern for translation files names'}, {'name': 'export_categories_as_categories', 'long': 'export-categories-as-categories', 'default': False, 'type': <class 'bool'>, 'help': 'Export categories as categories, instead of treating them as tags'}, {'name': 'export_comments', 'long': 'export-comments', 'default': False, 'type': <class 'bool'>, 'help': 'Export comments as .wpcomment files'}, {'name': 'html2text', 'long': 'html2text', 'default': False, 'type': <class 'bool'>, 'help': 'Uses html2text (needs to be installed with pip) to transform WordPress posts to MarkDown during import'}, {'name': 'transform_to_markdown', 'long': 'transform-to-markdown', 'default': False, 'type': <class 'bool'>, 'help': 'Uses WordPress page compiler to transform WordPress posts to HTML and then use html2text to transform them to MarkDown during import'}, {'name': 'transform_to_html', 'long': 'transform-to-html', 'default': False, 'type': <class 'bool'>, 'help': 'Uses WordPress page compiler to transform WordPress posts directly to HTML during import'}, {'name': 'use_wordpress_compiler', 'long': 'use-wordpress-compiler', 'default': False, 'type': <class 'bool'>, 'help': 'Instead of converting posts to markdown, leave them as is and use the WordPress page compiler'}, {'name': 'install_wordpress_compiler', 'long': 'install-wordpress-compiler', 'default': False, 'type': <class 'bool'>, 'help': 'Automatically installs the WordPress page compiler (either locally or in the new site) if required by other options.\nWarning: the compiler is GPL software!'}, {'name': 'tag_sanitizing_strategy', 'long': 'tag-sanitizing-strategy', 'default': 'first', 'help': 'lower: Convert all tag and category names to lower case\nfirst: Keep first spelling of tag or category name'}, {'name': 'one_file', 'long': 'one-file', 'default': False, 'type': <class 'bool'>, 'help': 'Save imported posts in the more modern one-file format.'}]
  code_re1 = re.compile('\\[code.* lang.*?="(.*?)?".*\\](.*?)\\[/code\\]', re.MULTILINE|re.DOTALL)
  code_re2 = re.compile('\\[sourcecode.* lang.*?="(.*?)?".*\\](.*?)\\[/sourcecode\\]', re.MULTILINE|re.DOTALL)
  code_re3 = re.compile('\\[code.*?\\](.*?)\\[/code\\]', re.MULTILINE|re.DOTALL)
  code_re4 = re.compile('\\[sourcecode.*?\\](.*?)\\[/sourcecode\\]', re.MULTILINE|re.DOTALL)
  doc_purpose = 'import a WordPress dump'
  doc_usage = '[options] wordpress_export_file'
  download_url_content_to_file(url, dst_path)

    Download some content (attachments) to a file.

  classmethod get_channel_from_file(filename, xml_preprocessor=None)

    Get channel from XML file.

    An optional ‘xml_preprocessor’ allows to modify the xml (typically to deal with variations in tags injected by some WP plugin)

  import_attachment(item, wordpress_namespace)

    Import an attachment to the site.

  import_postpage_item(item, wordpress_namespace, out_folder=None, attachments=None)

    Take an item from the feed and creates a post file.

  import_posts(channel)

    Import posts into the site.

  name = 'import_wordpress'
  needs_config = False
  populate_context(channel)

    Populate context with config for the site.

  process_item_if_attachment(item)

    Process attachments.

  process_item_if_post_or_page(item)

    Process posts and pages.

  classmethod read_xml_file(filename)

    Read XML file into memory.

  static transform_caption(content, use_html=False)

    Transform captions.

  transform_code(content)

    Transform code blocks.

  transform_content(content, post_format, attachments)

    Transform content into appropriate format.

  transform_multiple_newlines(content)

    Replace multiple newlines with only two.

  write_attachments_info(path, attachments)

    Write attachments info file.

nikola.plugins.command.import_wordpress.get_text_tag(tag, name, default)

  Get the text of an XML tag.

nikola.plugins.command.import_wordpress.install_plugin(site, plugin_name, output_dir=None, show_install_notes=False)

  Install a Nikola plugin.

nikola.plugins.command.import_wordpress.modernize_qtranslate_tags(xml_bytes)

  Uniformize the “tag” used by various version of qtranslate.

  The resulting byte string will only contain one set of qtranslate tags (namely [:LG] and [:]), older ones being converted to new ones.

nikola.plugins.command.import_wordpress.separate_qtranslate_tagged_langs(text)

  Parse the content of a wordpress post or page and separate languages.

  For qtranslateX tags: [:LL]blabla[:]

  Note: qtranslate* plugins had a troubled history and used various tags over time, application of the ‘modernize_qtranslate_tags’ function is required for this function to handle most of the legacy cases.

## 1.1.1.2.1.1.9. nikola.plugins.command.init module

Create a new site.

class nikola.plugins.command.init.CommandInit(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Create a new site.

  static ask_questions(target, demo=False)

    Ask some questions about Nikola.

  cmd_options = [{'name': 'quiet', 'long': 'quiet', 'short': 'q', 'default': False, 'type': <class 'bool'>, 'help': 'Do not ask questions about config.'}, {'name': 'demo', 'long': 'demo', 'short': 'd', 'default': False, 'type': <class 'bool'>, 'help': 'Create a site filled with example data.'}]
  classmethod copy_sample_site(target)

    Copy sample site data to target directory.

  static create_configuration(target)

    Create configuration file.

  static create_configuration_to_string()

    Return configuration file as a string.

  classmethod create_empty_site(target)

    Create an empty site with directories only.

  doc_purpose = 'create a Nikola site in the specified folder'
  doc_usage = '[--demo] [--quiet] folder'
  name = 'init'
  needs_config = False

nikola.plugins.command.init.format_default_translations_config(additional_languages)

  Adapt TRANSLATIONS setting for all additional languages.

nikola.plugins.command.init.format_navigation_links(additional_languages, default_lang, messages, strip_indexes=False)

  Return the string to configure NAVIGATION_LINKS.

nikola.plugins.command.init.get_default_translations_dict(default_lang, additional_languages)

  Generate a TRANSLATIONS dict matching the config from ‘format_default_translations_config’.

nikola.plugins.command.init.prepare_config(config)

  Parse sample config with JSON.

nikola.plugins.command.init.test_destination(destination, demo=False)

  Check if the destination already exists, which can break demo site creation.

## 1.1.1.2.1.1.10. nikola.plugins.command.new_page module

Create a new page.

class nikola.plugins.command.new_page.CommandNewPage(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Create a new page.

  cmd_options = [{'name': 'title', 'short': 't', 'long': 'title', 'type': <class 'str'>, 'default': '', 'help': 'Title for the page.'}, {'name': 'author', 'short': 'a', 'long': 'author', 'type': <class 'str'>, 'default': '', 'help': 'Author of the post.'}, {'name': 'onefile', 'short': '1', 'type': <class 'bool'>, 'default': False, 'help': 'Create the page with embedded metadata (single file format)'}, {'name': 'twofile', 'short': '2', 'type': <class 'bool'>, 'default': False, 'help': 'Create the page with separate metadata (two file format)'}, {'name': 'edit', 'short': 'e', 'type': <class 'bool'>, 'default': False, 'help': 'Open the page (and meta file, if any) in $EDITOR after creation.'}, {'name': 'content_format', 'short': 'f', 'long': 'format', 'type': <class 'str'>, 'default': '', 'help': 'Markup format for the page (use --available-formats for list)'}, {'name': 'available-formats', 'short': 'F', 'long': 'available-formats', 'type': <class 'bool'>, 'default': False, 'help': 'List all available input formats'}, {'name': 'import', 'short': 'i', 'long': 'import', 'type': <class 'str'>, 'default': '', 'help': 'Import an existing file instead of creating a placeholder'}]
  doc_purpose = 'create a new page in the site'
  doc_usage = '[options] [path]'
  name = 'new_page'

## 1.1.1.2.1.1.11. nikola.plugins.command.new_post module

Create a new post.

class nikola.plugins.command.new_post.CommandNewPost(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Create a new post.

  cmd_options = [{'name': 'is_page', 'short': 'p', 'long': 'page', 'type': <class 'bool'>, 'default': False, 'help': 'Create a page instead of a blog post. (see also: `nikola new_page`)'}, {'name': 'title', 'short': 't', 'long': 'title', 'type': <class 'str'>, 'default': '', 'help': 'Title for the post.'}, {'name': 'author', 'short': 'a', 'long': 'author', 'type': <class 'str'>, 'default': '', 'help': 'Author of the post.'}, {'name': 'tags', 'long': 'tags', 'type': <class 'str'>, 'default': '', 'help': 'Comma-separated tags for the post.'}, {'name': 'onefile', 'short': '1', 'type': <class 'bool'>, 'default': False, 'help': 'Create the post with embedded metadata (single file format)'}, {'name': 'twofile', 'short': '2', 'type': <class 'bool'>, 'default': False, 'help': 'Create the post with separate metadata (two file format)'}, {'name': 'edit', 'short': 'e', 'type': <class 'bool'>, 'default': False, 'help': 'Open the post (and meta file, if any) in $EDITOR after creation.'}, {'name': 'content_format', 'short': 'f', 'long': 'format', 'type': <class 'str'>, 'default': '', 'help': 'Markup format for the post (use --available-formats for list)'}, {'name': 'available-formats', 'short': 'F', 'long': 'available-formats', 'type': <class 'bool'>, 'default': False, 'help': 'List all available input formats'}, {'name': 'schedule', 'short': 's', 'type': <class 'bool'>, 'default': False, 'help': 'Schedule the post based on recurrence rule'}, {'name': 'import', 'short': 'i', 'long': 'import', 'type': <class 'str'>, 'default': '', 'help': 'Import an existing file instead of creating a placeholder'}, {'name': 'date-path', 'short': 'd', 'long': 'date-path', 'type': <class 'bool'>, 'default': False, 'help': 'Create post with date path (eg. year/month/day, see NEW_POST_DATE_PATH_FORMAT in config)'}]
  doc_purpose = 'create a new blog post or site page'
  doc_usage = '[options] [path]'
  filter_post_pages(compiler, is_post)

    Return the correct entry from post_pages.

    Information based on: * selected compilers * available compilers * post/page status

  name = 'new_post'
  print_compilers()

    List all available compilers in a human-friendly format.

nikola.plugins.command.new_post.get_date(schedule=False, rule=None, last_date=None, tz=None, iso8601=False)

  Return a date stamp, given a recurrence rule.

  schedule - bool:

    whether to use the recurrence rule or not

  rule - str:

    an iCal RRULE string that specifies the rule for scheduling posts

  last_date - datetime:

    timestamp of the last post

  tz - tzinfo:

    the timezone used for getting the current time.

  iso8601 - bool:

    whether to force ISO 8601 dates (instead of locale-specific ones)

nikola.plugins.command.new_post.get_default_compiler(is_post, compilers, post_pages)

  Given compilers and post_pages, return a reasonable default compiler for this kind of post/page.

## 1.1.1.2.1.1.12. nikola.plugins.command.orphans module

List all orphans.

class nikola.plugins.command.orphans.CommandOrphans(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  List all orphans.

  doc_description = 'List all orphans, i.e. all files that are in the output directory,\nbut are not generated by Nikola.\n\nOutput contains filenames only (it is passable to `xargs rm` or the like).'
  doc_purpose = 'list all orphans'
  name = 'orphans'

## 1.1.1.2.1.1.13. nikola.plugins.command.plugin module

Manage plugins.

class nikola.plugins.command.plugin.CommandPlugin(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Manage plugins.

  cmd_options = [{'name': 'install', 'short': 'i', 'long': 'install', 'type': <class 'str'>, 'default': '', 'help': 'Install a plugin.'}, {'name': 'uninstall', 'long': 'uninstall', 'short': 'r', 'type': <class 'str'>, 'default': '', 'help': 'Uninstall a plugin.'}, {'name': 'list', 'short': 'l', 'long': 'list', 'type': <class 'bool'>, 'default': False, 'help': 'Show list of available plugins.'}, {'name': 'url', 'short': 'u', 'long': 'url', 'type': <class 'str'>, 'help': 'URL for the plugin repository', 'default': 'https://plugins.getnikola.com/v8/plugins.json'}, {'name': 'user', 'long': 'user', 'type': <class 'bool'>, 'help': 'Install user-wide, available for all sites.', 'default': False}, {'name': 'upgrade', 'long': 'upgrade', 'type': <class 'bool'>, 'help': 'Upgrade all installed plugins.', 'default': False}, {'name': 'list_installed', 'long': 'list-installed', 'type': <class 'bool'>, 'help': 'List the installed plugins with their location.', 'default': False}]
  do_install(url, name, show_install_notes=True)

    Download and install a plugin.

  do_uninstall(name)

    Uninstall a plugin.

  do_upgrade(url)

    Upgrade all installed plugins.

  doc_purpose = 'manage plugins'
  doc_usage = '[-u url] [--user] [-i name] [-r name] [--upgrade] [-l] [--list-installed]'
  get_json(url)

    Download the JSON file with all plugins.

  json = None
  list_available(url)

    List all available plugins.

  list_installed()

    List installed plugins.

  name = 'plugin'
  needs_config = False
  output_dir = None

## 1.1.1.2.1.1.14. nikola.plugins.command.serve module

Start test server.

class nikola.plugins.command.serve.CommandServe(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Start test server.

  cmd_options = ({'name': 'port', 'short': 'p', 'long': 'port', 'default': 8000, 'type': <class 'int'>, 'help': 'Port number'}, {'name': 'address', 'short': 'a', 'long': 'address', 'type': <class 'str'>, 'default': '', 'help': 'Address to bind, defaults to all local IPv4 interfaces'}, {'name': 'detach', 'short': 'd', 'long': 'detach', 'type': <class 'bool'>, 'default': False, 'help': 'Detach from TTY (work in the background)'}, {'name': 'browser', 'short': 'b', 'long': 'browser', 'type': <class 'bool'>, 'default': False, 'help': 'Open the test server in a web browser'}, {'name': 'ipv6', 'short': '6', 'long': 'ipv6', 'type': <class 'bool'>, 'default': False, 'help': 'Use IPv6'})
  dns_sd = None
  doc_purpose = 'start the test webserver'
  doc_usage = '[options]'
  name = 'serve'
  shutdown(signum=None, _frame=None)

    Shut down the server that is running detached.

class nikola.plugins.command.serve.IPv6Server(server_address, RequestHandlerClass, bind_and_activate=True)

  Bases: :class:`http.server.HTTPServer`

  An IPv6 HTTPServer.

  address_family = 10

class nikola.plugins.command.serve.OurHTTPRequestHandler(*args, directory=None, **kwargs)

  Bases: :class:`http.server.SimpleHTTPRequestHandler`

  A request handler, modified for Nikola.

  extensions_map = {'': 'text/plain', '.%': 'application/x-trash', '.323': 'text/h323', '.3gp': 'video/3gpp', '.7z': 'application/x-7z-compressed', '.a': 'application/octet-stream', '.abw': 'application/x-abiword', '.ai': 'application/postscript', '.aif': 'audio/x-aiff', '.aifc': 'audio/x-aiff', '.aiff': 'audio/x-aiff', '.alc': 'chemical/x-alchemy', '.amr': 'audio/amr', '.anx': 'application/annodex', '.apk': 'application/vnd.android.package-archive', '.appcache': 'text/cache-manifest', '.application': 'application/x-ms-application', '.art': 'image/x-jg', '.asc': 'text/plain', '.asf': 'video/x-ms-asf', '.asn': 'chemical/x-ncbi-asn1-spec', '.aso': 'chemical/x-ncbi-asn1-binary', '.asx': 'video/x-ms-asf', '.atom': 'application/atom+xml', '.atomcat': 'application/atomcat+xml', '.atomsrv': 'application/atomserv+xml', '.au': 'audio/basic', '.avi': 'video/x-msvideo', '.awb': 'audio/amr-wb', '.axa': 'audio/annodex', '.axv': 'video/annodex', '.b': 'chemical/x-molconn-Z', '.bak': 'application/x-trash', '.bat': 'application/x-msdos-program', '.bcpio': 'application/x-bcpio', '.bib': 'text/x-bibtex', '.bin': 'application/octet-stream', '.bmp': 'image/x-ms-bmp', '.boo': 'text/x-boo', '.book': 'application/x-maker', '.brf': 'text/plain', '.bsd': 'chemical/x-crossfire', '.c': 'text/plain', '.c++': 'text/x-c++src', '.c3d': 'chemical/x-chem3d', '.cab': 'application/x-cab', '.cac': 'chemical/x-cache', '.cache': 'chemical/x-cache', '.cap': 'application/vnd.tcpdump.pcap', '.cascii': 'chemical/x-cactvs-binary', '.cat': 'application/vnd.ms-pki.seccat', '.cbin': 'chemical/x-cactvs-binary', '.cbr': 'application/x-cbr', '.cbz': 'application/x-cbz', '.cc': 'text/x-c++src', '.cda': 'application/x-cdf', '.cdf': 'application/x-cdf', '.cdr': 'image/x-coreldraw', '.cdt': 'image/x-coreldrawtemplate', '.cdx': 'chemical/x-cdx', '.cdy': 'application/vnd.cinderella', '.cef': 'chemical/x-cxf', '.cer': 'chemical/x-cerius', '.chm': 'chemical/x-chemdraw', '.chrt': 'application/x-kchart', '.cif': 'chemical/x-cif', '.class': 'application/java-vm', '.cls': 'text/x-tex', '.cmdf': 'chemical/x-cmdf', '.cml': 'chemical/x-cml', '.cod': 'application/vnd.rim.cod', '.com': 'application/x-msdos-program', '.cpa': 'chemical/x-compass', '.cpio': 'application/x-cpio', '.cpp': 'text/x-c++src', '.cpt': 'image/x-corelphotopaint', '.cr2': 'image/x-canon-cr2', '.crl': 'application/x-pkcs7-crl', '.crt': 'application/x-x509-ca-cert', '.crw': 'image/x-canon-crw', '.csd': 'audio/csound', '.csf': 'chemical/x-cache-csf', '.csh': 'text/x-csh', '.csm': 'chemical/x-csml', '.csml': 'chemical/x-csml', '.css': 'text/css', '.csv': 'text/csv', '.ctab': 'chemical/x-cactvs-binary', '.ctx': 'chemical/x-ctx', '.cu': 'application/cu-seeme', '.cub': 'chemical/x-gaussian-cube', '.cxf': 'chemical/x-cxf', '.cxx': 'text/x-c++src', '.d': 'text/x-dsrc', '.davmount': 'application/davmount+xml', '.dcm': 'application/dicom', '.dcr': 'application/x-director', '.ddeb': 'application/vnd.debian.binary-package', '.deb': 'application/x-debian-package', '.deploy': 'application/octet-stream', '.dif': 'video/dv', '.diff': 'text/x-diff', '.dir': 'application/x-director', '.djv': 'image/vnd.djvu', '.djvu': 'image/vnd.djvu', '.dl': 'video/dl', '.dll': 'application/x-msdos-program', '.dmg': 'application/x-apple-diskimage', '.dms': 'application/x-dms', '.doc': 'application/msword', '.docm': 'application/vnd.ms-word.document.macroEnabled.12', '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', '.dot': 'application/msword', '.dotm': 'application/vnd.ms-word.template.macroEnabled.12', '.dotx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', '.dv': 'video/dv', '.dvi': 'application/x-dvi', '.dx': 'chemical/x-jcamp-dx', '.dxr': 'application/x-director', '.emb': 'chemical/x-embl-dl-nucleotide', '.embl': 'chemical/x-embl-dl-nucleotide', '.eml': 'message/rfc822', '.ent': 'chemical/x-pdb', '.eot': 'application/vnd.ms-fontobject', '.eps': 'application/postscript', '.eps2': 'application/postscript', '.eps3': 'application/postscript', '.epsf': 'application/postscript', '.epsi': 'application/postscript', '.epub': 'application/epub+zip', '.erf': 'image/x-epson-erf', '.es': 'application/ecmascript', '.etx': 'text/x-setext', '.exe': 'application/x-msdos-program', '.ez': 'application/andrew-inset', '.fb': 'application/x-maker', '.fbdoc': 'application/x-maker', '.fch': 'chemical/x-gaussian-checkpoint', '.fchk': 'chemical/x-gaussian-checkpoint', '.fig': 'application/x-xfig', '.flac': 'audio/flac', '.fli': 'video/fli', '.flv': 'video/x-flv', '.fm': 'application/x-maker', '.frame': 'application/x-maker', '.frm': 'application/x-maker', '.gal': 'chemical/x-gaussian-log', '.gam': 'chemical/x-gamess-input', '.gamin': 'chemical/x-gamess-input', '.gan': 'application/x-ganttproject', '.gau': 'chemical/x-gaussian-input', '.gcd': 'text/x-pcs-gcd', '.gcf': 'application/x-graphing-calculator', '.gcg': 'chemical/x-gcg8-sequence', '.gen': 'chemical/x-genbank', '.gf': 'application/x-tex-gf', '.gif': 'image/gif', '.gjc': 'chemical/x-gaussian-input', '.gjf': 'chemical/x-gaussian-input', '.gl': 'video/gl', '.gnumeric': 'application/x-gnumeric', '.gpt': 'chemical/x-mopac-graph', '.gsf': 'application/x-font', '.gsm': 'audio/x-gsm', '.gtar': 'application/x-gtar', '.gz': 'application/gzip', '.h': 'text/plain', '.h++': 'text/x-c++hdr', '.h5': 'application/x-hdf5', '.hdf': 'application/x-hdf', '.hh': 'text/x-c++hdr', '.hin': 'chemical/x-hin', '.hpp': 'text/x-c++hdr', '.hqx': 'application/mac-binhex40', '.hs': 'text/x-haskell', '.hta': 'application/hta', '.htc': 'text/x-component', '.htm': 'text/html', '.html': 'text/html', '.hwp': 'application/x-hwp', '.hxx': 'text/x-c++hdr', '.ica': 'application/x-ica', '.ice': 'x-conference/x-cooltalk', '.ico': 'image/vnd.microsoft.icon', '.ics': 'text/calendar', '.icz': 'text/calendar', '.ief': 'image/ief', '.iges': 'model/iges', '.igs': 'model/iges', '.iii': 'application/x-iphone', '.info': 'application/x-info', '.inp': 'chemical/x-gamess-input', '.ins': 'application/x-internet-signup', '.iso': 'application/x-iso9660-image', '.isp': 'application/x-internet-signup', '.ist': 'chemical/x-isostar', '.istr': 'chemical/x-isostar', '.jad': 'text/vnd.sun.j2me.app-descriptor', '.jam': 'application/x-jam', '.jar': 'application/java-archive', '.java': 'text/x-java', '.jdx': 'chemical/x-jcamp-dx', '.jmz': 'application/x-jmol', '.jng': 'image/x-jng', '.jnlp': 'application/x-java-jnlp-file', '.jp2': 'image/jp2', '.jpe': 'image/jpeg', '.jpeg': 'image/jpeg', '.jpf': 'image/jpx', '.jpg': 'image/jpeg', '.jpg2': 'image/jp2', '.jpm': 'image/jpm', '.jpx': 'image/jpx', '.js': 'application/javascript', '.json': 'application/json', '.jsonld': 'application/ld+json', '.kar': 'audio/midi', '.key': 'application/pgp-keys', '.kil': 'application/x-killustrator', '.kin': 'chemical/x-kinemage', '.kml': 'application/vnd.google-earth.kml+xml', '.kmz': 'application/vnd.google-earth.kmz', '.kpr': 'application/x-kpresenter', '.kpt': 'application/x-kpresenter', '.ksh': 'text/plain', '.ksp': 'application/x-kspread', '.kwd': 'application/x-kword', '.kwt': 'application/x-kword', '.latex': 'application/x-latex', '.lha': 'application/x-lha', '.lhs': 'text/x-literate-haskell', '.lin': 'application/bbolin', '.lsf': 'video/x-la-asf', '.lsx': 'video/x-la-asf', '.ltx': 'text/x-tex', '.ly': 'text/x-lilypond', '.lyx': 'application/x-lyx', '.lzh': 'application/x-lzh', '.lzx': 'application/x-lzx', '.m1v': 'video/mpeg', '.m3g': 'application/m3g', '.m3u': 'audio/x-mpegurl', '.m3u8': 'application/x-mpegURL', '.m4a': 'audio/mpeg', '.maker': 'application/x-maker', '.man': 'application/x-troff-man', '.manifest': 'application/x-ms-manifest', '.markdown': 'text/markdown', '.mbox': 'application/mbox', '.mcif': 'chemical/x-mmcif', '.mcm': 'chemical/x-macmolecule', '.md': 'text/markdown', '.mdb': 'application/msaccess', '.me': 'application/x-troff-me', '.mesh': 'model/mesh', '.mht': 'message/rfc822', '.mhtml': 'message/rfc822', '.mid': 'audio/midi', '.midi': 'audio/midi', '.mif': 'application/x-mif', '.mjs': 'application/javascript', '.mkv': 'video/x-matroska', '.mm': 'application/x-freemind', '.mmd': 'chemical/x-macromodel-input', '.mmf': 'application/vnd.smaf', '.mml': 'text/mathml', '.mmod': 'chemical/x-macromodel-input', '.mng': 'video/x-mng', '.moc': 'text/x-moc', '.mol': 'chemical/x-mdl-molfile', '.mol2': 'chemical/x-mol2', '.moo': 'chemical/x-mopac-out', '.mop': 'chemical/x-mopac-input', '.mopcrt': 'chemical/x-mopac-input', '.mov': 'video/quicktime', '.movie': 'video/x-sgi-movie', '.mp2': 'audio/mpeg', '.mp3': 'audio/mpeg', '.mp4': 'video/mp4', '.mpa': 'video/mpeg', '.mpc': 'chemical/x-mopac-input', '.mpe': 'video/mpeg', '.mpeg': 'video/mpeg', '.mpega': 'audio/mpeg', '.mpg': 'video/mpeg', '.mpga': 'audio/mpeg', '.mph': 'application/x-comsol', '.mpv': 'video/x-matroska', '.ms': 'application/x-troff-ms', '.msh': 'model/mesh', '.msi': 'application/x-msi', '.msp': 'application/octet-stream', '.msu': 'application/octet-stream', '.mvb': 'chemical/x-mopac-vib', '.mxf': 'application/mxf', '.mxu': 'video/vnd.mpegurl', '.nb': 'application/mathematica', '.nbp': 'application/mathematica', '.nc': 'application/x-netcdf', '.nef': 'image/x-nikon-nef', '.nwc': 'application/x-nwc', '.nws': 'message/rfc822', '.o': 'application/x-object', '.obj': 'application/octet-stream', '.oda': 'application/oda', '.odb': 'application/vnd.oasis.opendocument.database', '.odc': 'application/vnd.oasis.opendocument.chart', '.odf': 'application/vnd.oasis.opendocument.formula', '.odg': 'application/vnd.oasis.opendocument.graphics', '.odi': 'application/vnd.oasis.opendocument.image', '.odm': 'application/vnd.oasis.opendocument.text-master', '.odp': 'application/vnd.oasis.opendocument.presentation', '.ods': 'application/vnd.oasis.opendocument.spreadsheet', '.odt': 'application/vnd.oasis.opendocument.text', '.oga': 'audio/ogg', '.ogg': 'audio/ogg', '.ogv': 'video/ogg', '.ogx': 'application/ogg', '.old': 'application/x-trash', '.one': 'application/onenote', '.onepkg': 'application/onenote', '.onetmp': 'application/onenote', '.onetoc2': 'application/onenote', '.opf': 'application/oebps-package+xml', '.opus': 'audio/ogg', '.orc': 'audio/csound', '.orf': 'image/x-olympus-orf', '.otf': 'font/ttf', '.otg': 'application/vnd.oasis.opendocument.graphics-template', '.oth': 'application/vnd.oasis.opendocument.text-web', '.otp': 'application/vnd.oasis.opendocument.presentation-template', '.ots': 'application/vnd.oasis.opendocument.spreadsheet-template', '.ott': 'application/vnd.oasis.opendocument.text-template', '.oza': 'application/x-oz-application', '.p': 'text/x-pascal', '.p12': 'application/x-pkcs12', '.p7c': 'application/pkcs7-mime', '.p7r': 'application/x-pkcs7-certreqresp', '.pac': 'application/x-ns-proxy-autoconfig', '.pas': 'text/x-pascal', '.pat': 'image/x-coreldrawpattern', '.patch': 'text/x-diff', '.pbm': 'image/x-portable-bitmap', '.pcap': 'application/vnd.tcpdump.pcap', '.pcf': 'application/x-font-pcf', '.pcf.Z': 'application/x-font-pcf', '.pcx': 'image/pcx', '.pdb': 'chemical/x-pdb', '.pdf': 'application/pdf', '.pfa': 'application/x-font', '.pfb': 'application/x-font', '.pfr': 'application/font-tdpfr', '.pfx': 'application/x-pkcs12', '.pgm': 'image/x-portable-graymap', '.pgn': 'application/x-chess-pgn', '.pgp': 'application/pgp-encrypted', '.pk': 'application/x-tex-pk', '.pl': 'text/x-perl', '.pls': 'audio/x-scpls', '.pm': 'text/x-perl', '.png': 'image/png', '.pnm': 'image/x-portable-anymap', '.pot': 'text/plain', '.potm': 'application/vnd.ms-powerpoint.template.macroEnabled.12', '.potx': 'application/vnd.openxmlformats-officedocument.presentationml.template', '.ppa': 'application/vnd.ms-powerpoint', '.ppam': 'application/vnd.ms-powerpoint.addin.macroEnabled.12', '.ppm': 'image/x-portable-pixmap', '.pps': 'application/vnd.ms-powerpoint', '.ppsm': 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', '.ppsx': 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', '.ppt': 'application/vnd.ms-powerpoint', '.pptm': 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', '.pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation', '.prf': 'application/pics-rules', '.prt': 'chemical/x-ncbi-asn1-ascii', '.ps': 'application/postscript', '.psd': 'image/x-photoshop', '.pwz': 'application/vnd.ms-powerpoint', '.py': 'text/plain', '.pyc': 'application/x-python-code', '.pyo': 'application/x-python-code', '.qgs': 'application/x-qgis', '.qt': 'video/quicktime', '.qtl': 'application/x-quicktimeplayer', '.ra': 'audio/x-realaudio', '.ram': 'audio/x-pn-realaudio', '.rar': 'application/rar', '.ras': 'image/x-cmu-raster', '.rb': 'application/x-ruby', '.rd': 'chemical/x-mdl-rdfile', '.rdf': 'application/rdf+xml', '.rdp': 'application/x-rdp', '.rgb': 'image/x-rgb', '.rm': 'audio/x-pn-realaudio', '.roff': 'application/x-troff', '.ros': 'chemical/x-rosdal', '.rpm': 'application/x-redhat-package-manager', '.rss': 'application/x-rss+xml', '.rtf': 'application/rtf', '.rtx': 'text/richtext', '.rxn': 'chemical/x-mdl-rxnfile', '.scala': 'text/x-scala', '.sce': 'application/x-scilab', '.sci': 'application/x-scilab', '.sco': 'audio/csound', '.scr': 'application/x-silverlight', '.sct': 'text/scriptlet', '.sd': 'chemical/x-mdl-sdfile', '.sd2': 'audio/x-sd2', '.sda': 'application/vnd.stardivision.draw', '.sdc': 'application/vnd.stardivision.calc', '.sdd': 'application/vnd.stardivision.impress', '.sdf': 'chemical/x-mdl-sdfile', '.sds': 'application/vnd.stardivision.chart', '.sdw': 'application/vnd.stardivision.writer', '.ser': 'application/java-serialized-object', '.sfd': 'application/vnd.font-fontforge-sfd', '.sfv': 'text/x-sfv', '.sgf': 'application/x-go-sgf', '.sgl': 'application/vnd.stardivision.writer-global', '.sgm': 'text/x-sgml', '.sgml': 'text/x-sgml', '.sh': 'text/x-sh', '.shar': 'application/x-shar', '.shp': 'application/x-qgis', '.shtml': 'text/html', '.shx': 'application/x-qgis', '.sid': 'audio/prs.sid', '.sig': 'application/pgp-signature', '.sik': 'application/x-trash', '.silo': 'model/mesh', '.sis': 'application/vnd.symbian.install', '.sisx': 'x-epoc/x-sisx-app', '.sit': 'application/x-stuffit', '.sitx': 'application/x-stuffit', '.skd': 'application/x-koan', '.skm': 'application/x-koan', '.skp': 'application/x-koan', '.skt': 'application/x-koan', '.sldm': 'application/vnd.ms-powerpoint.slide.macroEnabled.12', '.sldx': 'application/vnd.openxmlformats-officedocument.presentationml.slide', '.smi': 'application/smil+xml', '.smil': 'application/smil+xml', '.snd': 'audio/basic', '.so': 'application/octet-stream', '.spc': 'chemical/x-galactic-spc', '.spl': 'application/x-futuresplash', '.spx': 'audio/ogg', '.sql': 'application/x-sql', '.src': 'application/x-wais-source', '.srt': 'text/plain', '.stc': 'application/vnd.sun.xml.calc.template', '.std': 'application/vnd.sun.xml.draw.template', '.sti': 'application/vnd.sun.xml.impress.template', '.stl': 'application/sla', '.stw': 'application/vnd.sun.xml.writer.template', '.sty': 'text/x-tex', '.sv4cpio': 'application/x-sv4cpio', '.sv4crc': 'application/x-sv4crc', '.svg': 'image/svg+xml', '.svgz': 'image/svg+xml', '.sw': 'chemical/x-swissprot', '.swf': 'application/x-shockwave-flash', '.swfl': 'application/x-shockwave-flash', '.sxc': 'application/vnd.sun.xml.calc', '.sxd': 'application/vnd.sun.xml.draw', '.sxg': 'application/vnd.sun.xml.writer.global', '.sxi': 'application/vnd.sun.xml.impress', '.sxm': 'application/vnd.sun.xml.math', '.sxw': 'application/vnd.sun.xml.writer', '.t': 'application/x-troff', '.tar': 'application/x-tar', '.taz': 'application/x-gtar-compressed', '.tcl': 'text/x-tcl', '.tex': 'text/x-tex', '.texi': 'application/x-texinfo', '.texinfo': 'application/x-texinfo', '.text': 'text/plain', '.tgf': 'chemical/x-mdl-tgf', '.tgz': 'application/x-gtar-compressed', '.thmx': 'application/vnd.ms-officetheme', '.tif': 'image/tiff', '.tiff': 'image/tiff', '.tk': 'text/x-tcl', '.tm': 'text/texmacs', '.torrent': 'application/x-bittorrent', '.tr': 'application/x-troff', '.ts': 'video/MP2T', '.tsp': 'application/dsptype', '.tsv': 'text/tab-separated-values', '.ttc': 'font/collection', '.ttf': 'font/ttf', '.ttl': 'text/turtle', '.txt': 'text/plain', '.udeb': 'application/x-debian-package', '.uls': 'text/iuls', '.ustar': 'application/x-ustar', '.val': 'chemical/x-ncbi-asn1-binary', '.vcard': 'text/vcard', '.vcd': 'application/x-cdlink', '.vcf': 'text/vcard', '.vcs': 'text/x-vcalendar', '.vmd': 'chemical/x-vmd', '.vms': 'chemical/x-vamas-iso14976', '.vrm': 'x-world/x-vrml', '.vrml': 'x-world/x-vrml', '.vsd': 'application/vnd.visio', '.vss': 'application/vnd.visio', '.vst': 'application/vnd.visio', '.vsw': 'application/vnd.visio', '.wad': 'application/x-doom', '.wasm': 'application/wasm', '.wav': 'audio/x-wav', '.wax': 'audio/x-ms-wax', '.wbmp': 'image/vnd.wap.wbmp', '.wbxml': 'application/vnd.wap.wbxml', '.webm': 'video/webm', '.webmanifest': 'application/manifest+json', '.wiz': 'application/msword', '.wk': 'application/x-123', '.wm': 'video/x-ms-wm', '.wma': 'audio/x-ms-wma', '.wmd': 'application/x-ms-wmd', '.wml': 'text/vnd.wap.wml', '.wmlc': 'application/vnd.wap.wmlc', '.wmls': 'text/vnd.wap.wmlscript', '.wmlsc': 'application/vnd.wap.wmlscriptc', '.wmv': 'video/x-ms-wmv', '.wmx': 'video/x-ms-wmx', '.wmz': 'application/x-ms-wmz', '.woff': 'font/woff', '.woff2': 'font/woff2', '.wp5': 'application/vnd.wordperfect5.1', '.wpd': 'application/vnd.wordperfect', '.wrl': 'x-world/x-vrml', '.wsc': 'text/scriptlet', '.wsdl': 'application/xml', '.wvx': 'video/x-ms-wvx', '.wz': 'application/x-wingz', '.x3d': 'model/x3d+xml', '.x3db': 'model/x3d+binary', '.x3dv': 'model/x3d+vrml', '.xbm': 'image/x-xbitmap', '.xcf': 'application/x-xcf', '.xcos': 'application/x-scilab-xcos', '.xht': 'application/xhtml+xml', '.xhtml': 'application/xhtml+xml', '.xlam': 'application/vnd.ms-excel.addin.macroEnabled.12', '.xlb': 'application/vnd.ms-excel', '.xls': 'application/vnd.ms-excel', '.xlsb': 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', '.xlsm': 'application/vnd.ms-excel.sheet.macroEnabled.12', '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', '.xlt': 'application/vnd.ms-excel', '.xltm': 'application/vnd.ms-excel.template.macroEnabled.12', '.xltx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', '.xml': 'application/xml', '.xpdl': 'application/xml', '.xpi': 'application/x-xpinstall', '.xpm': 'image/x-xpixmap', '.xsd': 'application/xml', '.xsl': 'application/xslt+xml', '.xslt': 'application/xslt+xml', '.xspf': 'application/xspf+xml', '.xtel': 'chemical/x-xtel', '.xul': 'application/vnd.mozilla.xul+xml', '.xwd': 'image/x-xwindowdump', '.xyz': 'chemical/x-xyz', '.xz': 'application/x-xz', '.zip': 'application/zip', '.zmt': 'chemical/x-mopac-input', '.~': 'application/x-trash'}
  log_message(*args)

    Log messages. Or not, depending on a setting.

  quiet = False
  send_head()

    Send response code and MIME header.

    This is common code for GET and HEAD commands.

    Return value is either a file object (which has to be copied to the outputfile by the caller unless the command was HEAD, and must be closed by the caller under all circumstances), or None, in which case the caller has nothing further to do.

## 1.1.1.2.1.1.15. nikola.plugins.command.status module

Display site status.

class nikola.plugins.command.status.CommandStatus(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Display site status.

  cmd_options = [{'name': 'list_drafts', 'short': 'd', 'long': 'list-drafts', 'type': <class 'bool'>, 'default': False, 'help': 'List all drafts'}, {'name': 'list_modified', 'short': 'm', 'long': 'list-modified', 'type': <class 'bool'>, 'default': False, 'help': 'List all modified files since last deployment'}, {'name': 'list_private', 'short': 'p', 'long': 'list-private', 'type': <class 'bool'>, 'default': False, 'help': 'List all private posts'}, {'name': 'list_published', 'short': 'P', 'long': 'list-published', 'type': <class 'bool'>, 'default': False, 'help': 'List all published posts'}, {'name': 'list_scheduled', 'short': 's', 'long': 'list-scheduled', 'type': <class 'bool'>, 'default': False, 'help': 'List all scheduled posts'}]
  doc_description = 'Show information about the posts and site deployment.'
  doc_purpose = 'display site status'
  doc_usage = '[-d|--list-drafts] [-m|--list-modified] [-p|--list-private] [-P|--list-published] [-s|--list-scheduled]'
  human_time(dt)

    Translate time into a human-friendly representation.

  logger = None
  name = 'status'

## 1.1.1.2.1.1.16. nikola.plugins.command.subtheme module

Given a swatch name from bootswatch.com or hackerthemes.com and a parent theme, creates a custom theme.

class nikola.plugins.command.subtheme.CommandSubTheme(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Given a swatch name from bootswatch.com and a parent theme, creates a custom theme.

  cmd_options = [{'name': 'name', 'short': 'n', 'long': 'name', 'default': 'custom', 'type': <class 'str'>, 'help': 'New theme name'}, {'name': 'swatch', 'short': 's', 'default': '', 'type': <class 'str'>, 'help': 'Name of the swatch from bootswatch.com.'}, {'name': 'parent', 'short': 'p', 'long': 'parent', 'default': 'bootstrap4', 'help': 'Parent theme name'}]
  doc_purpose = 'given a swatch name from bootswatch.com or hackerthemes.com and a parent theme, creates a custom theme'
  doc_usage = '[options]'
  name = 'subtheme'

## 1.1.1.2.1.1.17. nikola.plugins.command.theme module

Manage themes.

class nikola.plugins.command.theme.CommandTheme(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Manage themes.

  cmd_options = [{'name': 'install', 'short': 'i', 'long': 'install', 'type': <class 'str'>, 'default': '', 'help': 'Install a theme.'}, {'name': 'uninstall', 'long': 'uninstall', 'short': 'r', 'type': <class 'str'>, 'default': '', 'help': 'Uninstall a theme.'}, {'name': 'list', 'short': 'l', 'long': 'list', 'type': <class 'bool'>, 'default': False, 'help': 'Show list of available themes.'}, {'name': 'list_installed', 'long': 'list-installed', 'type': <class 'bool'>, 'help': 'List the installed themes with their location.', 'default': False}, {'name': 'url', 'short': 'u', 'long': 'url', 'type': <class 'str'>, 'help': 'URL for the theme repository', 'default': 'https://themes.getnikola.com/v8/themes.json'}, {'name': 'getpath', 'short': 'g', 'long': 'get-path', 'type': <class 'str'>, 'default': '', 'help': 'Print the path for installed theme'}, {'name': 'copy-template', 'short': 'c', 'long': 'copy-template', 'type': <class 'str'>, 'default': '', 'help': 'Copy a built-in template into templates/ or your theme'}, {'name': 'new', 'short': 'n', 'long': 'new', 'type': <class 'str'>, 'default': '', 'help': 'Create a new theme'}, {'name': 'new_engine', 'long': 'engine', 'type': <class 'str'>, 'default': 'mako', 'help': 'Engine to use for new theme (mako or jinja)'}, {'name': 'new_parent', 'long': 'parent', 'type': <class 'str'>, 'default': 'base', 'help': 'Parent to use for new theme'}, {'name': 'new_legacy_meta', 'long': 'legacy-meta', 'type': <class 'bool'>, 'default': False, 'help': 'Create legacy meta files for new theme'}]
  copy_template(template)

    Copy the named template file from the parent to a local theme or to templates/.

  do_install(name, data)

    Download and install a theme.

  do_install_deps(url, name)

    Install themes and their dependencies.

  do_uninstall(name)

    Uninstall a theme.

  doc_purpose = 'manage themes'
  doc_usage = '[-u url] [-i theme_name] [-r theme_name] [-l] [--list-installed] [-g] [-n theme_name] [-c template_name]'
  get_json(url)

    Download the JSON file with all plugins.

  get_path(name)

    Get path for an installed theme.

  json = None
  list_available(url)

    List all available themes.

  list_installed()

    List all installed themes.

  name = 'theme'
  new_theme(name, engine, parent, create_legacy_meta=False)

    Create a new theme.

  output_dir = 'themes'

## 1.1.1.2.1.1.18. nikola.plugins.command.version module

Print Nikola version.

class nikola.plugins.command.version.CommandVersion(*args, **kwargs)

  Bases: :class:`nikola.plugin_categories.Command`

  Print Nikola version.

  cmd_options = [{'name': 'check', 'long': 'check', 'short': '', 'default': False, 'type': <class 'bool'>, 'help': 'Check for new versions.'}]
  doc_purpose = 'print the Nikola version number'
  doc_usage = '[--check]'
  name = 'version'
  needs_config = False