Skip to content

Commit

Permalink
Worked on documentation (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Oct 4, 2020
1 parent 639570c commit 9ada06e
Show file tree
Hide file tree
Showing 8 changed files with 272 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Files to ignore by git.

# Back-up files
*~
*.swp

# Generic auto-generated build files
*.pyc
*.pyo

# Specific auto-generated build files
/.tox
/__pycache__
/build
/*.egg-info
/dist

# Code review files
/.review

# Pycharm files
/.idea

# Test coverage files
.coverage
tests-coverage.txt
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
This project contains documentation about developing Open Source DFIR tools.

### Also see

* [Documentation](https://open-source-dfir.readthedocs.io)
* [Blog](https://osdfir.blogspot.com)
* [Open Source DFIR Slack community](https://github.com/open-source-dfir/slack)

127 changes: 127 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# -*- coding: utf-8 -*-
"""Sphinx build configuration file."""

from __future__ import unicode_literals

import os

from sphinx.ext import apidoc

from docutils import nodes
from docutils import transforms


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '2.0.1'

# 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.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx_markdown_tables',
'recommonmark'
]

autodoc_mock_imports = []

# General information about the project.
# pylint: disable=redefined-builtin
project = 'Open Source DFIR tools'
copyright = 'Open Source DFIR tools authors'
version = '20200920'
release = '20200920'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']

# The master toctree document.
master_doc = 'index'

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- 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 = 'default'

# Output file base name for HTML help builder.
htmlhelp_basename = 'opensourcedfirdoc'


# -- Options linkcheck ----------------------------------------------------

linkcheck_ignore = [
]


# -- Code to rewrite links for readthedocs --------------------------------

class MarkdownLinkFixer(transforms.Transform):
"""Transform definition to parse .md references to internal pages."""

default_priority = 1000

_URI_PREFIXES = []

def _FixLinks(self, node):
"""Corrects links to .md files not part of the documentation.
Args:
node (docutils.nodes.Node): docutils node.
Returns:
docutils.nodes.Node: docutils node, with correct URIs outside
of Markdown pages outside the documentation.
"""
if isinstance(node, nodes.reference) and 'refuri' in node:
reference_uri = node['refuri']
for uri_prefix in self._URI_PREFIXES:
if (reference_uri.startswith(uri_prefix) and
not reference_uri.endswith('.asciidoc')):
node['refuri'] = reference_uri + '.md'
break

return node

def _Traverse(self, node):
"""Traverses the document tree rooted at node.
Args:
node (docutils.nodes.Node): docutils node.
"""
self._FixLinks(node)

for child_node in node.children:
self._Traverse(child_node)

# pylint: disable=arguments-differ
def apply(self):
"""Applies this transform on document tree."""
self._Traverse(self.document)


# pylint: invalid-name
def setup(app):
"""Called at Sphinx initialization.
Args:
app (sphinx.application.Sphinx): Sphinx application.
"""
# Triggers sphinx-apidoc to generate API documentation.
app.add_config_value(
'recommonmark_config', {'enable_auto_toc_tree': True}, True)
app.add_transform(MarkdownLinkFixer)
18 changes: 18 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Welcome to the Open Source DFIR tools documentation
===================================================

Open Source DFIR tools documentation

.. toctree::
:maxdepth: 2

Contributing to Open Source DFIR <sources/Contributing>


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docutils
recommonmark
sphinx>=2.0.1
sphinx-markdown-tables
50 changes: 50 additions & 0 deletions docs/sources/Contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contributing to Open Source DFIR

From time to time someone asks how do I contribute to Open Source DFIR. This
page contains relevant tips and links from such conversations.

## First determine a scope in which you want to contribute

Open Source DFIR is combination of multiple very broad topics. First try to
determine a scope. If you are new to either open source or DFIR start we
recommend to small, you and extend the scope at any point in time.

Some questions that could help in determining a scope to start with:

* Any specific topics?
* Any specific technologies?
* Any tools/projects that you frequently use? What helps if you have ideas on how to improve these tools.

### Specific topics or technologies

What helps is to find a topic or technology that you are passionate about,
find interesting, or that is beneficial to your day-to-day work.

Consider:

* writing a [Forensics Wiki article](http://forensicswiki.xyz)
* writing a [blog post](https://osdfir.blogspot.com/)
* disussing it on [Open Source DFIR slack](https://github.com/open-source-dfir/slack)

### Tools/projects that you frequently use

* First learn as much as you can about the technologies the tools/project uses
* Learn about the development and/or maintenance processes of a project
* Learn about the contributors and/or community guidelines of a project
* Learn about the open source licenses and/or agreements a project uses and if you are able to contribute
* Reach out to the project maintainers to see what good starter projects are. It take a while to get to learn a code base.

## Second determine how you want to contribute

### Contribution by programming/software development

Programming and/or developing software you learn best by doing.

### Contribution by testing

### Contribution by research

### Contribution by documentation

### Contribution by supporting other users

31 changes: 31 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Installation and deployment script."""

try:
from setuptools import setup
except ImportError:
from distutils.core import setup


setup(
name='lore',
version='20200920',
description='Documentation about developing Open Source DFIR tools',
long_description=(
'Documentation about developing Open Source DFIR tools'),
license='CC-BY-4.0 License',
url='https://github.com/open-source-dfir/lore',
maintainer='Open Source DFIR maintainers',
maintainer_email='open-source-dfir-maintainers@googlegroups.com',
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
data_files=[
('share/doc/lore', [
'LICENSE', 'README.md']),
],
)
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tox]
envlist = docs

[testenv:docs]
usedevelop = true
deps =
-rdocs/requirements.txt
commands =
sphinx-build -b html -d build/doctrees docs dist/docs
sphinx-build -b linkcheck docs dist/docs

0 comments on commit 9ada06e

Please sign in to comment.