diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..b996602 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 612f383..9e26863 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ __pycache__ -*.egg-info/ \ No newline at end of file +_build +.DS_Store +build/ +*.egg-info/ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..5f1c6d1 --- /dev/null +++ b/docs/Makefile @@ -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) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..eb5878a --- /dev/null +++ b/docs/conf.py @@ -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"] diff --git a/docs/how_to_research.rst b/docs/how_to_research.rst new file mode 100644 index 0000000..d072b34 --- /dev/null +++ b/docs/how_to_research.rst @@ -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. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..38924f7 --- /dev/null +++ b/docs/index.rst @@ -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: sschulh@umd.edu + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + how_to_research + using_latex + using_github + prompt_systematic_review + + + +.. Indices and tables +.. ================== + +.. * :ref:`genindex` +.. * :ref:`modindex` +.. * :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..32bb245 --- /dev/null +++ b/docs/make.bat @@ -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 diff --git a/docs/prompt_systematic_review.rst b/docs/prompt_systematic_review.rst new file mode 100644 index 0000000..9601e12 --- /dev/null +++ b/docs/prompt_systematic_review.rst @@ -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: \ No newline at end of file diff --git a/docs/using_github.rst b/docs/using_github.rst new file mode 100644 index 0000000..3ed8926 --- /dev/null +++ b/docs/using_github.rst @@ -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. \ No newline at end of file diff --git a/docs/using_latex.rst b/docs/using_latex.rst new file mode 100644 index 0000000..fc32b58 --- /dev/null +++ b/docs/using_latex.rst @@ -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) diff --git a/requirements.txt b/requirements.txt index 0b62b1f..e4c9c6e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,7 @@ huggingface_hub pytest jellyfish black +sphinx +renku-sphinx-theme +sphinx-autobuild -e . \ No newline at end of file