Skip to content

Commit c1d394e

Browse files
authored
Merge pull request #39 from dirkolbrich/mermaid
remove duplicate include of mermaid.js
2 parents cb86789 + 1f47644 commit c1d394e

File tree

10 files changed

+85
-78
lines changed

10 files changed

+85
-78
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
{% if page.mermaid == true %}
12
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.0.0/mermaid.min.js"></script>
23
<script>
3-
mermaid.initialize({
4-
startOnLoad:true,
5-
theme: 'default'
6-
});
7-
window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid'));
4+
var config = {
5+
startOnLoad:true,
6+
theme: 'default'
7+
};
8+
mermaid.initialize(config);
9+
window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid'));
810
</script>
11+
{% endif %}

_layouts/mermaid.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

technical/ChecklistForNewFeatureC++.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
layout: default
3+
---
4+
15
# Checklist for adding a new feature to an existing workbench in C++
26

37
This checklist is intended as an aid to contributors.

technical/CreatePythonBindingForCpp.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Background
1+
---
2+
layout: default
3+
---
4+
5+
# Create a Python Binding for C++
6+
7+
## Background
28

39
It becomes necessary at times to expand the FreeCAD API further by exposing functions that are available in the source code in c++ to the python. This process is generally referred to as creating a binding.
410

@@ -18,7 +24,7 @@ The XML file YourClassPy.xml provides information about the functions and attrib
1824

1925
For this example, we will look at the wrapper for the Base::Axis C++ class. The XML description file begins with:
2026

21-
```XML
27+
```xml
2228
<GenerateModel xmlns:xsi##"http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation##"generateMetaModel_Module.xsd">
2329
<PythonExport
2430
Father##"PyObjectBase"
@@ -42,7 +48,7 @@ For this example, we will look at the wrapper for the Base::Axis C++ class. The
4248

4349
Following this preamble, a list of methods and attributes is given. The format of a method is:
4450

45-
```XML
51+
```xml
4652
<Methode Name##"move">
4753
<Documentation>
4854
<UserDocu>
@@ -55,7 +61,7 @@ Following this preamble, a list of methods and attributes is given. The format o
5561

5662
The format of an attribute is:
5763

58-
```XML
64+
```xml
5965
<Attribute Name##"Direction" ReadOnly##"false">
6066
<Documentation>
6167
<UserDocu>Direction vector of the Axis</UserDocu>
@@ -66,24 +72,25 @@ The format of an attribute is:
6672

6773
For an attribute, if "ReadOnly" is false, you will provide both a getter and a setter function. If it is true, only a getter is allowed. In this case we will be required to provide two functions in the implementation C++ file:
6874

69-
```C++
75+
```cpp
7076
Py::Object AxisPy::getDirection(void) const
77+
````
7178
7279
and:
7380
81+
```cpp
7482
void AxisPy::setDirection(Py::Object arg)
7583
```
7684
85+
## Implementation C++ File
7786
78-
## Implementation Cplusplus File
79-
80-
The implementation C++ file YourClassPyImp.cpp provides the "glue" that connects the C++ and Python structures together, effectively translating from one language to the other. The FreeCAD C++-to-Python system provides a number of C++ classes that map to their corresponding Python type. The most fundamental of these is the incode|Py::Object class -- rarely created directly, this class provides the base of the inheritance tree, and is used as the return type for any function that is returning Python data.
87+
The implementation C++ file `YourClassPyImp.cpp` provides the "glue" that connects the C++ and Python structures together, effectively translating from one language to the other. The FreeCAD C++-to-Python system provides a number of C++ classes that map to their corresponding Python type. The most fundamental of these is the incode `Py::Object` class - rarely created directly, this class provides the base of the inheritance tree, and is used as the return type for any function that is returning Python data.
8188
8289
### Include Files
8390
8491
Your C++ implementation file will include the following files:
8592
86-
```C++
93+
```cpp
8794
#include "PreCompiled.h"
8895
8996
#include "YourClass.h"
@@ -99,7 +106,7 @@ Of course, you may include whatever other C++ headers your code requires to func
99106
100107
Your C++ implementation must contain the definition of the PyInit function: for example, for the Axis class wrapper, this is
101108
102-
```C++
109+
```cpp
103110
int AxisPy::PyInit(PyObject* args, PyObject* /*kwd*/)
104111
105112
//Within this function you will most likely need to parse incoming arguments to the constructor: the most important function for this purpose is the Python-provided incode|PyArg_ParseTuple. It takes in the
@@ -123,7 +130,6 @@ For a complete list of format specifiers see [https://docs.python.org/3/c-api/ar
123130
* PyArg_VaParse (PyObject *, const char *, va_list);
124131
* PyArg_VaParseTupleAndKeywords (PyObject *, PyObject *, const char *, char **, va_list);
125132
126-
127133
## Another Explanation
128134
129135
The basic structure of a program to expose functionality to Python is something like this:
@@ -147,14 +153,10 @@ There is a convention for return values from our C++/Python connections:
147153
* xxxxxPyImp routines return a PyObject* pointer (see TopoShapePyImp.cpp)
148154
* AppmyModulePy.cpp routines return a Py::Object (see https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Part/App/AppPartPy.cpp and FreeCAD/src/Mod/Part/AppPartPy.cpp.
149155
150-
151156
## See also
152157
153158
* [https://forum.freecadweb.org/viewtopic.php?p##314796#p314617]
154159
* [https://forum.freecadweb.org/viewtopic.php?p##560639#p560639] Forum discussion: Adding Commands in Python to C++ Workbench
155160
* [https://forum.freecadweb.org/viewtopic.php?f##10&t##70750] Another forum thread
156161
* (./Workbench creation.md)
157162
* [https://github.com/FreeCAD/FreeCAD/commit/20b86e55b8dd1873f4c19e036d047528c9ff7f4e] Commit 20b86e5, exposing OCC's precision methods to Python
158-
159-
160-

technical/SourceTreeBasics.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22
layout: default
33
mermaid: true
44
---
5-
# "Partial View of the FreeCAD Source Tree"
65

7-
"A picture of the most commonly encountered branches of the tree."
6+
# Partial View of the FreeCAD Source Tree
87

9-
{{page.mermaid}}
8+
A picture of the most commonly encountered branches of the tree.
109

1110
The full FreeCAD source tree has many other branches, but most Contributors will
1211
only need to deal with these:
1312

14-
1513
![The FreeCAD Source Tree](./SourceTreeBasics.svg)
1614

17-
1815
```mermaid
1916
graph LR
2017
A[src] --- B[App: Documents, DocumentObjects, EventPropagation]
@@ -28,4 +25,3 @@ graph LR
2825
E --- I["..."]
2926
end
3027
```
31-

technical/TheApplicationModule.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
---
22
layout: default
3-
mermaid: true
43
---
54

6-
# "The Application Module"
5+
# The Application Module
76

8-
"An overview of application module structure."
7+
An overview of application module structure.
98

10-
The functionality of FreeCAD is separated into Modules. Some Modules are built into FreeCAD and some are Extension Modules (a form of plug-in). Once installed, Extension Modules behave exactly as built-in Modules.
9+
The functionality of FreeCAD is separated into Modules. Some Modules are built into FreeCAD and some are Extension Modules (a form of plug-in). Once installed, Extension Modules behave exactly as built-in Modules.
1110

12-
Application Modules provide specialized functions and may store specialized data. Examples of Application Modules are Arch (for buildings) and Sketcher (for drawing Sketches).
11+
Application Modules provide specialized functions and may store specialized data. Examples of Application Modules are Arch (for buildings) and Sketcher (for drawing Sketches).
1312

1413
Application Modules are almost always divided into two parts: App which manages the relevant document objects and operations on them, and Gui which handles the display.
1514

technical/developerglossary.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
layout: default
33
---
4-
# "Developer's Glossary"
54

6-
"Some terms that a developer may run across."
5+
# Developer's Glossary
76

8-
Note that there may be subtle differences in how some terms are used by developers vs how they are used by users.
7+
Some terms that a developer may run across.
98

9+
Note that there may be subtle differences in how some terms are used by developers vs how they are used by users.
1010

1111
* Binding: the mechanism for linking C++ functionality to and from Python.
1212
* CI (Continuous Integration): the mechanism by which Pull Requests are automatically built and unit tested.
@@ -17,9 +17,6 @@ Note that there may be subtle differences in how some terms are used by develope
1717
* Pull Request: how a contributor indicates that they have a change to be merged
1818
* ViewProvider: an object that provides painting services for a Feature. The ViewProvider is notified of changes in a Features properties and, if the change affects the visual representation of the Feature, updates the display. Note that in some modules (ex TechDraw with the Qt GraphicsFramework) there is another layer of functionality that manages the painting.
1919

20-
21-
22-
2320
## See Also
2421

2522
* [FreeCAD glossary wiki entry](https://wiki.freecad.org/Glossary)

technical/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
22
layout: default
33
---
4+
45
# Technical
56

67
Technical information of interest to Contributors.
78

8-
99
## The Basics
10+
1011
- [Developer's Glossary](./developerglossary.md)
1112
- [Source Tree Basics](./SourceTreeBasics.md)
1213
- [The Application Module](./TheApplicationModule.md)
@@ -19,8 +20,8 @@ Technical information of interest to Contributors.
1920
- [Coin3d](https://www.coin3d.org/): a [scenegraph](https://wiki.freecad.org/Scenegraph) manager based on OpenInventor that handles drawing in the 3d window.
2021
- [Pivy](https://wiki.freecad.org/Pivy): a Python binding for Coin3d
2122

22-
2323
## Modifying FreeCAD
24+
2425
- Contributing to FreeCAD
2526
- The process for submitting changes to FreeCAD is described in the [CONTRIBUTING.md](https://github.com/FreeCAD/FreeCAD/blob/master/CONTRIBUTING.md)
2627
file in the root of the source tree.
@@ -30,11 +31,8 @@ Technical information of interest to Contributors.
3031
- [Create a Python Binding for C++ Class](./CreatePythonBindingForCpp.md)
3132
- [Checklist for Adding a Feature to a Workbench in C++](./ChecklistForNewFeatureC++.md)
3233

34+
## See Also
3335

34-
35-
36-
37-
### See Also
3836
- [Wiki Developer Hub](https://wiki.freecad.org/Developer_hub)
3937
- [Compiling](https://wiki.freecad.org/Developer_hub#Compiling_FreeCAD)
4038
- [Useful Python Modules](https://wiki.freecad.org/Extra_python_modules)

technical/preferences.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
layout: default
33
---
4+
45
# Handling Preferences
56

6-
How to retrieve and update user preferences
7+
How to retrieve and update user preferences.
78

8-
The user.cfg Xml file contains a hierarchical list of all the preferences used by FreeCAD.
9+
The `user.cfg` XML file contains a hierarchical list of all the preferences used by FreeCAD.
910

1011
Each module has its own branch of the hierarchy starting under Preferences/Mod.
1112

@@ -24,4 +25,5 @@ Good examples of retrieving parameters can be found in:
2425
* C++: [various methods](https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/TechDraw/App/Preferences.cpp) in /Mod/TechDraw/App/Preferences.cpp
2526

2627
## See also
28+
2729
* [Preference Editor wiki entry](https://wiki.freecad.org/Preferences_Editor)

0 commit comments

Comments
 (0)