Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 1.55 KB

CONTRIBUTING.org

File metadata and controls

35 lines (28 loc) · 1.55 KB

How do I contribute to SPARK by Example?

You may contribute to SPARK by Example by opening issues for bugs or improvements. If you want to propose a patch to correct an issue, please submit a pull request.

SPARK by Example documentation is organised as Org files that are generated by other Org files located in the doc/org_templates directory. Therefore, if you want to change an Org file, please change the one located in the template directory.

The template Org files do not contain directly code snippets but Org directive like the following:

#+INCLUDE: "../../../non-mutating/naive_find_p.ads" :src ada :range-begin "function Find" :range-end "\s-*(\([^()]*?\(?:\n[^()]*\)*?\)*)\s-*\([^;]*?\(?:\n[^;]*\)*?\)*;" :lines "9-20"

This directive allow to include the correct snippet in the corresponding Org generated file. The range-begin and range-end regular expressions are used to automatically compute the lines attribute used to insert in the final Org page the correct snippet.

In order to be able to update the lines attribute, you have to evaluate the Emacs functions located in the emacs/org-config.el directory. You can then use the tof/create-org-include-from-ada-function function to create an INCLUDE Org directive from an Ada function if you want. Use the endless/update-includes function to update line numbers in your current buffer.