Skip to content

Commit

Permalink
Merge pull request #24 from trigaten/docs_site
Browse files Browse the repository at this point in the history
Docs site
  • Loading branch information
trigaten authored Nov 2, 2023
2 parents 8a9df74 + 0db8fdd commit e9e3993
Show file tree
Hide file tree
Showing 11 changed files with 256 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy
on:
push:
branches: [main, docs_site]

jobs:
docs:
name: Generate Website
runs-on: ubuntu-latest
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

- name: Install dependencies
run: pip install -r requirements.txt && git clone https://github.com/trigaten/Prompt_Systematic_Review.git

- name: Build
run: sphinx-build -b dirhtml -v docs/ build

- name: Upload to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/

permissions:
contents: write
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
__pycache__
*.egg-info/
_build
.DS_Store
build/
*.egg-info/
24 changes: 24 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

github:
@make html
@cp -a build/html/. ./docs

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
33 changes: 33 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import renku_sphinx_theme

project = "Prompt Systematic Review"
copyright = "2023, Schulhoff et al."
author = "Schulhoff et al."
release = "0.0.1"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.autodoc",
"renku_sphinx_theme",
]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output


html_theme = "renku"
html_static_path = ["_static"]
41 changes: 41 additions & 0 deletions docs/how_to_research.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
=========================
How to Research
=========================

It can be difficult to know where to start researching a topic, especially as an undergrad with little or no experience.
I had to figure this out a few years, so let me save you some time :)


The Beginning
=========================

At the beginning of the research process, you want to go broad in your subject. For example, if you are researching Gen AI Security,
you might look up "Generative AI Security review" (or overview), "Generative AI Security survey", and similar terms. If you can find
a review paper, great, read it. If not, start with the most relevant paper, read the abstract/conclusion, then jump to *related work*.
Most papers have a related work section; it discusses papers related to that one in the field.

Use **Google Scholar**/ArXiv/Semantic Scholar


How to Read a Paper
=========================
If you need to understand a technique proposed by a paper (rather than just learn broadly about the field), do this:

I am using the Chain of thought paper as an example: https://arxiv.org/pdf/2201.11903.pdf

- Read the abstract+conclusion
- Read the description of the proposed method/analysis
- Look at any images (usually exclude graphs)
- Skip related work
- Skip experimental setup
- Skip ablations
- Read the conclusion, and perhaps some discussion

You will usually only want to read the sections I said to skip if you *really* need to understand the technique (for example, if you are comparing it to other techniques).

How to keep track of information
==================================================

Do whatever your project lead suggests. The way I keep track of info is by adding the citation to the Overleaf
bibliography file (read the on Overleaf), then writing comments above it as my notes. I try to just started writing in the regular tex
file as soon as I get a decent understanding of the field.
37 changes: 37 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.. Prompt Systematic Review documentation master file, created by
sphinx-quickstart on Thu Nov 2 15:25:04 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Documentation for the Systematic Prompt Review Project
====================================================

This website contains all the information you need to understand the research process for this project. The first three sections
are about how to do research and use LaTeX/Github. The fourth section is an autogenerated API reference for our codebase.
Make sure to write Sphinx-style docstrings (look this up).

Quick Info:

- Github: https://github.com/trigaten/Prompt_Systematic_Review
- Overleaf: DM Sander or sub-team leader
- The plan document: check announcements in slack
- Main contact: [email protected]


.. toctree::
:maxdepth: 2
:caption: Contents:

how_to_research
using_latex
using_github
prompt_systematic_review



.. Indices and tables
.. ==================
.. * :ref:`genindex`
.. * :ref:`modindex`
.. * :ref:`search`
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
12 changes: 12 additions & 0 deletions docs/prompt_systematic_review.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
prompt_systematic_review
========

.. automodule:: prompt_systematic_review.arxiv_source
:members:


.. automodule:: prompt_systematic_review.paperSource
:members:

.. automodule:: prompt_systematic_review.utils
:members:
22 changes: 22 additions & 0 deletions docs/using_github.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
=========================
Using Git/Github
=========================

Git and Github are important tools for collaborative coding projects. Here's a basic guide:

1. **Git Basics**: Git is a version control system that helps you track changes in your code. You need to have Git installed on your computer. Learn a few commands like `git clone` (to get a copy of the project), `git pull` (to get the latest changes), `git push` (to share your changes), and `git commit` (to save your work).

2. **Github**: Github is a platform where we store our code, which is based on Git.

3. **Cloning a Repository**: To start working on a project, use `git clone https://github.com/trigaten/Prompt_Systematic_Review.git` to bring the project to your computer.

4. **Branches and Pull Requests**: When you want to change something in the project, create a "branch." It's like creating a separate workspace for your ideas. After you're done, you can ask others to review your work by making a "pull request." It's like getting feedback from others before your changes become part of the main project.

5. **Commit Messages**: When you make changes, write clear and simple messages about what you did. Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

If you have any questions, feel free to ask me or your sub-team leader.

For more help, you can check out the Github Help website: [Github Quickstart](https://docs.github.com/en/get-started/quickstart/hello-world).

Note that our Github repo has a CI pipeline, which automatically runs tests, style checks, and more when you request you merge new code.
This helps ensure that broken code does not get merged in.
16 changes: 16 additions & 0 deletions docs/using_latex.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=========================
Using LaTeX
=========================

LaTeX is a typesetting language commonly used for creating documents with complex formatting, such as research papers
and scientific articles. For our collaborative document editing, we will be using Overleaf, an online LaTeX editor that
allows multiple people to work on a document simultaneously. If you need access to the LaTeX repository for our project,
please don't hesitate to reach out to me or your sub team lead.

Here are some basic formatting tips with LaTeX:

1. **Section Headings**: You can create section headings using LaTeX by starting a line with a series of `#` symbols. The number of `#` symbols determines the section level. For example, `#` is a top-level section, `##` is a subsection, and so on.

2. **Italics and Bold**: To make text italic, you can use `\textit{}` and to make text bold, you can use `\textbf{}`. For example, `\textit{italic text}` and `\textbf{bold text}`.

Learn more here: [Link to LaTeX Documentation](https://www.overleaf.com/learn)
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ huggingface_hub
pytest
jellyfish
black
sphinx
renku-sphinx-theme
sphinx-autobuild
-e .

0 comments on commit e9e3993

Please sign in to comment.