Skip to content

Commit

Permalink
adding more documentation and summary of citelang in readme and docs … (
Browse files Browse the repository at this point in the history
#38)

* adding more documentation and summary of citelang in readme and docs per review
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch authored May 20, 2022
1 parent cd9d639 commit 1796989
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 18 deletions.
58 changes: 48 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,66 @@

[![PyPI version](https://badge.fury.io/py/citelang.svg)](https://badge.fury.io/py/citelang)

![https://raw.githubusercontent.com/vsoch/citelang/main/docs/assets/img/pypi-citelang.png](https://raw.githubusercontent.com/vsoch/citelang/main/docs/assets/img/pypi-citelang.png)

Welcome to CiteLang! This is the first markdown syntax for citing software. Importantly,
when you use CiteLang to reference software.
Welcome to CiteLang! CiteLang provides methods and graph-based modeling to study software
ecosystems. You can use CiteLang for your research, or a provided tool to generate
software graph artifacts, including (but not limited to):

1. Generate basic software credit trees (citelang graph, badge, or credit)
1. Generate basic software credit trees (citelang graph, badge, or markdown credit)
2. Give credit accounting for dependencies! (see [software-credit.md](software-credit.md))
3. Actions (automation) for the above!

No - we aren't using DOIs! A manually crafted identifier that a human has to remember to generate,
For the examples above, we aren't using DOIs! A manually crafted identifier that a human has to remember to generate,
in addition to a publication or release, is too much work for people to reasonably do. As research
software engineers we also want to move away from the traditional "be valued like an academic" model.
We are getting software metadata and a reference to an identifier via a package manager. This means
that when you publish your software, you should publish it to an appropriate package manager.

⭐️ [Documentation](https://vsoch.github.io/citelang) ⭐️
## Getting Started

If you want to use CiteLang as an analysis library, jump into the mode detailed ⭐️ [Documentation](https://vsoch.github.io/citelang) ⭐️
or look specifically at the [Python API](https://vsoch.github.io/citelang/getting_started/user-guide.html#python).
As an example analysis, the [RSEPedia Software Ecosystem](https://rseng.github.io/rsepedia-analysis/) is a completed automated setup that parses and summarizes dependencies across the [Research Software Encyclopedia](https://rseng.github.io/software) weekly, and it's powered by CiteLang! You can do similar analyses or build your own tools using CiteLang. We will provide a small summary of the tools available here.

### Badges

CiteLang [**Badges**](https://vsoch.github.io/citelang/getting_started/user-guide.html#badge) can show an entire credit tree
for a project:

![https://raw.githubusercontent.com/vsoch/citelang/main/docs/assets/img/pypi-citelang.png](https://raw.githubusercontent.com/vsoch/citelang/main/docs/assets/img/pypi-citelang.png)

or can be generated to be interactive web interfaces as [shown here](https://vsoch.github.io/citelang/_static/example/badge/treemap/index.html).

![https://raw.githubusercontent.com/vsoch/citelang/main/docs/getting_started/img/badge.png](https://raw.githubusercontent.com/vsoch/citelang/main/docs/getting_started/img/badge.png)

See the [badge](https://vsoch.github.io/citelang/_static/example/badge/treemap/index.html) documentation for more examples
of customizing the look, or level of abstraction. You can automatically generate or update
a badge for your repository using the provided [GitHub Action](https://vsoch.github.io/citelang/getting_started/user-guide.html#badge-github-action).

### Credit and Graph

If you want to visually show dependency graphs, using [**Credit**](https://vsoch.github.io/citelang/getting_started/user-guide.html#credit)
will print this to the console, and optionally in json if you want just the data. With the [**Graph**](https://vsoch.github.io/citelang/getting_started/user-guide.html#graph) command you can render different kinds of pretty graphs (or data formats dot, cypher, gexf) using this same data.

![https://raw.githubusercontent.com/vsoch/citelang/main/examples/console/citelang-console-pypi.png](https://raw.githubusercontent.com/vsoch/citelang/main/examples/console/citelang-console-pypi.png)
![https://raw.githubusercontent.com/vsoch/citelang/main/examples/cypher/graph.png](https://raw.githubusercontent.com/vsoch/citelang/main/examples/cypher/graph.png)

### Contributions

CiteLang has a [**Contrib**](https://vsoch.github.io/citelang/getting_started/user-guide.html#contrib) command and underlying
API that can dig into your git history and look at contributions based on lines. You can read a complete write-up
and see examples [in this blog post](https://vsoch.github.io/2022/citelang-contrib/#citelang-contrib). It is currently being used
by the SingularityCE project to say thank you to contributors!

[![asciicast](https://asciinema.org/a/486073.svg)](https://asciinema.org/a/486073?speed=2)

If you want to generate data programatically, we provide [A GitHub action](https://vsoch.github.io/citelang/getting_started/user-guide.html#contribute-github-action).


### Render and Generate

The functionality that originally derived the name - a "markdown syntax for citations" means that we can start from a [markdown paper](https://github.com/vsoch/citelang/blob/main/examples/pre-render.md) that has some number of CiteLang formatted references, and result in a [rendered paper](https://github.com/vsoch/citelang/blob/main/examples/post-render.md) that includes a credit table. This is done with the [**Render**](https://vsoch.github.io/citelang/getting_started/user-guide.html#render) command, or you can just output a table into its own markdown file with [**Generate**](https://vsoch.github.io/citelang/getting_started/user-guide.html#gen-generate). We provide [an example here](https://github.com/vsoch/citelang/blob/main/software-credit.md) and also provide a [GitHub action](https://vsoch.github.io/citelang/getting_started/user-guide.html#generate-github-action) for you to generate this for your own repository.

## TODO

- save commit content and message for further filtering
- colors should be meaningful

## Contributors

Expand Down
4 changes: 2 additions & 2 deletions citelang/main/contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,14 @@ def get_commit_range(self, shallow=False):
"""
# Single commit, honor previous behavior
if self.start and self.start == self.end:
log_range = self.start +"~1.." + self.start
log_range = self.start + "~1.." + self.start
# Open or closed range with start
elif self.start:
log_range = self.start + ".." + self.end
# Open range with end (initial commit to end)
elif self.end:
log_range = self.end
# No start or end... all history for HEAD
# No start or end... all history for HEAD
else:
log_range = "HEAD"

Expand Down
22 changes: 20 additions & 2 deletions docs/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,38 @@
Getting Started
===============

CiteLang is the first markdown syntax for citing software. It allows you to:
CiteLang is software for digging into software credit. It provides methods and graph-based modeling to study
single projects or entire software ecosystems. You can use CiteLang for your research, or a provided tool to generate
software graph artifacts, including (but not limited to):

1. Generate basic software credit trees
2. Give credit accounting for dependencies
3. Choose the filter or threshold you want for credit

Background
==========

We don't believe that "the traditional academic way" of citing papers makes sense for software.
Why should we be trying to generate separate DOIs (digital object identifiers) when we already have
established ways to "publish" and distribute software using package managers? The getting started
guides here will show you the basics of using CiteLang, and of course if you have a question
or issue, please `let us know <https://github.com/vsoch/citelang/issues>`_

Summary of Tools
================

Along with the underlying Python methods to derive your own credit graphs (see `this writeup about the RSEPedia Software Ecosystem <https://vsoch.github.io/2022/rsepedia/>`_) it provides a set of "ready to go" tools that can be used to visualize or understand your project:

- **Badge** can show an entire credit tree for a project, and are generated as static png or interactive web page.
- **Credit** can visually show dependency graphs in the terminal.
- **Graph** can output these same graphs in output formats for graphing software.
- **Contrib** (contributions) can be assessed on the level of the line. See `this write-up on citelang contrib <https://vsoch.github.io/2022/citelang-contrib/#citelang-contrib>`_ for more detail.
- **Render** takes a markdown formatting with CiteLang references, and renders into it a summary table. A comparison can be made to .all-contributors.rc, except instead of contributors, we summarize dependencies.
- **Generate** does the same, but doesn't require a pre-written paper. You can dump out markdown to describe software of your choosing.


.. toctree::
:maxdepth: 2
:maxdepth: 3

installation
user-guide
Expand Down
37 changes: 34 additions & 3 deletions docs/getting_started/user-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ Render

This command will support rendering an entire markdown file with software references,
and create a citation summary table that can represent shared credit across your dependencies, weighted equally (by default)
per package. As an example, let's say we start with _`this markdown file <https://github.com/vsoch/citelang/blob/main/examples/pre-paper.md>`_ .
per package. As an example, let's say we start with `this markdown file <https://github.com/vsoch/citelang/blob/main/examples/pre-paper.md>`_ .
You'll notice there are software references formatted as follows:

.. code-block:: markdown
Expand Down Expand Up @@ -909,6 +909,12 @@ directory. We can load that file and filter it for different contexts.
GitHub Action
*************
CiteLang has several GitHub actions to make it easy to automate using some of
these tools, and proudly show your software credit trees.
Generate GitHub Action
======================
If you want to generate a software credit markdown for your software (perhaps after a release)
you can do the following. Here is an example of releasing a Python package.
Expand Down Expand Up @@ -954,8 +960,12 @@ you can do the following. Here is an example of releasing a Python package.
Notice that we have generated a libraries.io key to make the process faster.
and customized the file to be named software-credit.md. Here is how you would generate
a png badge for your repository, named custom or by the ``<manager>-<package>.png`` (default).
and customized the file to be named software-credit.md.

Badge GitHub Action
===================

Here is how you would generate a png badge for your repository, named custom or by the ``<manager>-<package>.png`` (default).

.. code-block:: yaml
Expand Down Expand Up @@ -986,6 +996,27 @@ Adding an additional step to commit a file and push to main might look like:
You could also open a pull request if you want to review first!

Contribute GitHub Action
========================

This is to generate contribution data, and you can decide what to do with it.
It could be for provenance or analysis.


.. code-block:: yaml
- name: Generate CiteLang Contrib Data
uses: vsoch/citelang/action/contrib@main
with:
root: /tmp/cloned-repo
outdir: /tmp/cloned-repo/.contrib
start: 0.0.52
end: 0.0.53
detail: true
If you would like another tool developed, or to discuss an idea for software credit,
please don't hesitate to reach out to @vsoch.

******
Python
******
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CiteLang
:alt: GitHub stars
:target: https://github.com/vsoch/citelang/stargazers

.. image:: https://raw.githubusercontent.com/vsoch/citelang/main/docs/assets/img/citelang-tree.png
.. image:: https://raw.githubusercontent.com/vsoch/citelang/main/docs/assets/img/pypi-citelang.png

Welcome to CiteLang! This is the first markdown syntax for citing software. Importantly,
when you use CiteLang to reference software.
Expand Down

0 comments on commit 1796989

Please sign in to comment.