License builder for the nonviolent public license family
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Endo bfa8363f8c Merged ghost sections without title while preserving `role=restriction*`
When exporting the DocBook template to Markdown or PDF (there might be more cases in formats not tested), Pandoc still includes a section into the exported format even when it doesn't have a title.

In the Markdown files, this means added lines `##` in-between ```Any use by a business that is privately owned and managed, and that seeks to generate profit from the labor of employees paid by salary or other wages, is not permitted under this license.``` and ```You may exercise the rights granted in the license grant for any purposes only if:```.

When the license doesn't strip out elements with `role=restriction-attribution` (for the no-attribution licenses), there's another empty section title between ```You do not use the Work to either Discriminate or spread Hate Speech on the basis of sex, sexual orientation, gender identity, race, age, disability, color, national origin, religion, caste, or lower economic status.``` and ```If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made by any Licensor to remove credit from a Collection or Adaptation, keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing:```

This is an issue when exporting the Markdown license files to PDFs, because these ghost sections will be visible in the outline viewer of a PDF reader. Might also be a potential issue if users want to generate a table of contents or index along with their PDF — it might put these ghost section in, too.

To fix this, DocBook doesn't have a special "ghost section" type (closest is a `<bridgehead>`, but that completely screws over formatting), so the contents of the ghost sections were merged into its parent with the `role` of the ghost section in mind.

Output was sanity-tested with these commands:
```sh
$ xml ed -d "/article/info" template.xml | xml ed -d "*/*/*[@role='restriction']" | pandoc -f docbook -t markdown -s -o test-modified.md
$ xml ed -d "/article/info" template-original.xml | xml ed -d "*/*/*[@role='restriction']" | pandoc -f docbook -t markdown -s -o test-original.md
$ diff test-original.md test-modified.md
215,216d214
< ## 
<``` `template-original.xml` is the file from this branch's last commit, c706fa6efc5ecd7217342fa5f7e23fdc613fb07b.
2 years ago
LICENSE Create LICENSE 3 years ago
Makefile fixes to makefile 3 years ago
README.md Added donation link to readme 3 years ago
cnpl-na.md regenerated license texts with fixed typos 2 years ago
cnpl.md regenerated license texts with fixed typos 2 years ago
nvpl-na.md regenerated license texts with fixed typos 2 years ago
nvpl.md regenerated license texts with fixed typos 2 years ago
template.xml Merged ghost sections without title while preserving `role=restriction*` 2 years ago

README.md

Nonviolent Public License Builder v7

The Nonviolent Public License builder project provides 4 licenses generated from a common template.

  • NVPL - Nonviolent Public License
  • CNPL - Cooperative Nonviolent Public License
  • NVPL-NA - Nonviolent Public License No Attributions
  • CNPL-NA - Cooperative Nonviolent Public License No Attributions

The text of the licenses are all in this repository each in its own .md (markdown) file above. You don't have to download and use the builder unless you are contributing.

License information and summary of purpose here: https://thufie.lain.haus/NPL.html

Please use the "+" at the end of the license URI (like: CNPL-NAv7+) to allow future license revisions to apply.

These licenses are based off of the CSL (Cooperative Software License) which is not actually just for software.

Use this license header (for the CNPL) in your source files if you want:

// Copyright (C) 2021 (Author) <email>
// This file is part of project.
//
// project is non-violent software: you can use, redistribute,
// and/or modify it under the terms of the CNPLv7+ as found
// in the LICENSE file in the source code root directory or
// at <https://git.pixie.town/thufie/npl-builder>.
//
// project comes with ABSOLUTELY NO WARRANTY, to the extent
// permitted by applicable law.  See the CNPL for details.

Contributing:

  • Only make or propose edits to the license text in template.xml
  • Changes that are not common among license have some special formatting requirements. Check the output of make to ensure everything is removed from the licenses it does not apply to.
    • If a change only applies to the CNPL or CNPL-NA use the "restriction-cooperative" role attribute
    • If a change only applies to the CNPL or NVPL (or in other words, it has to do with requiring attributions) use the "restriction-attribution" role attribute.
  • When in doubt, make a bug report and I will be glad to help!

Dependencies:

  • pandoc - for converting from docbook5 xml to markdown
  • xmlstarlet - provides the xml binary
  • make

Example Usage:

  • make all - (re)generate all license markdown files from template.xml
  • Use pandoc to convert the license into the format of your choice. Use pandoc --list-output-formats for a list of available document formats. Try some of these:
    • pandoc -f markdown -t pdf -s -o cnpl.pdf cnpl.md - Build a pdf of the CNPL (requires texlive-core)
    • pandoc -f markdown -t odt -s -o cnpl.odt cnpl.md - Convert the license to an odt file and open it for spell and grammar check in LibreOffice.
    • pandoc -f markdown -t plain -s -o cnpl.txt cnpl.md - Produce a plaintext version of the license.