marktip 0.7.3__tar.gz → 0.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {marktip-0.7.3 → marktip-0.8.0}/.gitignore +2 -0
- marktip-0.8.0/CMakeLists.txt +114 -0
- marktip-0.8.0/PKG-INFO +1026 -0
- marktip-0.8.0/README.md +997 -0
- marktip-0.8.0/bindings/python/ast.cpp +45 -0
- marktip-0.8.0/bindings/python/bindings.h +36 -0
- marktip-0.8.0/bindings/python/input.h +45 -0
- marktip-0.8.0/bindings/python/markdown.cpp +44 -0
- marktip-0.7.3/src/marktip.cpp → marktip-0.8.0/bindings/python/module.cpp +66 -23
- marktip-0.8.0/bindings/python/options.cpp +90 -0
- marktip-0.8.0/bindings/python/output.h +58 -0
- {marktip-0.7.3 → marktip-0.8.0}/pyproject.toml +4 -1
- {marktip-0.7.3 → marktip-0.8.0}/python/marktip/__init__.py +45 -0
- marktip-0.8.0/python/marktip/presets.json +92 -0
- marktip-0.8.0/python/marktip/presets.py +68 -0
- marktip-0.8.0/python/marktip/schema.py +202 -0
- {marktip-0.7.3 → marktip-0.8.0}/scripts/benchmark.py +32 -11
- marktip-0.8.0/scripts/generate_wasm_parity.py +309 -0
- marktip-0.8.0/src/ast.cpp +111 -0
- marktip-0.8.0/src/ast.h +59 -0
- marktip-0.8.0/src/compiler.h +7 -0
- marktip-0.8.0/src/content.cpp +561 -0
- marktip-0.8.0/src/content.h +49 -0
- marktip-0.8.0/src/document_input.h +376 -0
- marktip-0.8.0/src/document_output.h +113 -0
- marktip-0.8.0/src/entities.cpp +188 -0
- marktip-0.7.3/src/serializer.h → marktip-0.8.0/src/entities.h +2 -3
- {marktip-0.7.3 → marktip-0.8.0}/src/errors.h +2 -2
- marktip-0.8.0/src/form.cpp +143 -0
- marktip-0.8.0/src/form.h +28 -0
- marktip-0.8.0/src/inherit.cpp +211 -0
- marktip-0.8.0/src/inherit.h +20 -0
- marktip-0.8.0/src/lift.cpp +978 -0
- marktip-0.8.0/src/lift.h +10 -0
- {marktip-0.7.3 → marktip-0.8.0}/src/parser.cpp +108 -76
- marktip-0.8.0/src/parser.h +19 -0
- marktip-0.8.0/src/path.h +33 -0
- marktip-0.8.0/src/policy.cpp +330 -0
- marktip-0.8.0/src/policy.h +44 -0
- marktip-0.8.0/src/schema.cpp +268 -0
- marktip-0.8.0/src/schema.h +214 -0
- marktip-0.8.0/src/schema_builder.cpp +763 -0
- marktip-0.8.0/src/schema_builder.h +61 -0
- marktip-0.8.0/src/schema_input.h +218 -0
- marktip-0.8.0/src/serializer.cpp +1428 -0
- marktip-0.8.0/src/serializer.h +12 -0
- marktip-0.8.0/src/spelling.cpp +52 -0
- marktip-0.8.0/src/spelling.h +51 -0
- marktip-0.8.0/src/tags.cpp +329 -0
- marktip-0.8.0/src/tags.h +42 -0
- marktip-0.8.0/src/validate.cpp +467 -0
- marktip-0.8.0/src/validate.h +69 -0
- marktip-0.8.0/src/value.cpp +194 -0
- marktip-0.8.0/src/value.h +52 -0
- {marktip-0.7.3 → marktip-0.8.0}/third_party/md4c/src/md4c.c +243 -80
- {marktip-0.7.3 → marktip-0.8.0}/third_party/md4c/src/md4c.h +29 -0
- marktip-0.8.0/third_party/md4c/upstream_metadata/README.md +86 -0
- marktip-0.7.3/CMakeLists.txt +0 -40
- marktip-0.7.3/PKG-INFO +0 -404
- marktip-0.7.3/README.md +0 -375
- marktip-0.7.3/src/ast.cpp +0 -1477
- marktip-0.7.3/src/ast.h +0 -144
- marktip-0.7.3/src/parser.h +0 -13
- marktip-0.7.3/src/serializer.cpp +0 -841
- marktip-0.7.3/tests/test_cjk_friendly.py +0 -94
- marktip-0.7.3/tests/test_content_model.py +0 -159
- marktip-0.7.3/tests/test_document.py +0 -64
- marktip-0.7.3/tests/test_errors.py +0 -296
- marktip-0.7.3/tests/test_node_type_policy.py +0 -100
- marktip-0.7.3/tests/test_nul_normalization.py +0 -176
- marktip-0.7.3/tests/test_parse.py +0 -186
- marktip-0.7.3/tests/test_roundtrip.py +0 -421
- marktip-0.7.3/tests/test_serialize.py +0 -228
- marktip-0.7.3/tests/test_strict.py +0 -748
- marktip-0.7.3/tests/test_uri_policy.py +0 -430
- marktip-0.7.3/tests/test_validate.py +0 -173
- marktip-0.7.3/third_party/md4c/upstream_metadata/README.md +0 -56
- {marktip-0.7.3 → marktip-0.8.0}/.github/workflows/build-distributions.yml +0 -0
- {marktip-0.7.3 → marktip-0.8.0}/LICENSE +0 -0
- {marktip-0.7.3 → marktip-0.8.0}/scripts/build_cjk_map.py +0 -0
- {marktip-0.7.3 → marktip-0.8.0}/third_party/md4c/LICENSE.md +0 -0
- {marktip-0.7.3 → marktip-0.8.0}/third_party/md4c/src/cjk.h +0 -0
- {marktip-0.7.3 → marktip-0.8.0}/third_party/md4c/src/entity.c +0 -0
- {marktip-0.7.3 → marktip-0.8.0}/third_party/md4c/src/entity.h +0 -0
- {marktip-0.7.3 → marktip-0.8.0}/third_party/md4c/upstream_metadata/Unicode-LICENSE.txt +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.15)
|
|
2
|
+
|
|
3
|
+
project(marktip LANGUAGES C CXX)
|
|
4
|
+
|
|
5
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
6
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
7
|
+
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
8
|
+
|
|
9
|
+
if(NOT DEFINED SKBUILD_PROJECT_VERSION)
|
|
10
|
+
set(SKBUILD_PROJECT_VERSION "0.8.0")
|
|
11
|
+
endif()
|
|
12
|
+
|
|
13
|
+
add_library(md4c STATIC
|
|
14
|
+
third_party/md4c/src/md4c.c
|
|
15
|
+
third_party/md4c/src/entity.c
|
|
16
|
+
)
|
|
17
|
+
target_include_directories(md4c PUBLIC third_party/md4c/src)
|
|
18
|
+
target_compile_definitions(md4c PRIVATE MD4C_USE_UTF8)
|
|
19
|
+
set_target_properties(md4c PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
20
|
+
|
|
21
|
+
add_library(marktip_core STATIC
|
|
22
|
+
src/ast.cpp
|
|
23
|
+
src/content.cpp
|
|
24
|
+
src/entities.cpp
|
|
25
|
+
src/form.cpp
|
|
26
|
+
src/inherit.cpp
|
|
27
|
+
src/lift.cpp
|
|
28
|
+
src/parser.cpp
|
|
29
|
+
src/policy.cpp
|
|
30
|
+
src/schema.cpp
|
|
31
|
+
src/schema_builder.cpp
|
|
32
|
+
src/serializer.cpp
|
|
33
|
+
src/spelling.cpp
|
|
34
|
+
src/tags.cpp
|
|
35
|
+
src/validate.cpp
|
|
36
|
+
src/value.cpp
|
|
37
|
+
)
|
|
38
|
+
target_include_directories(marktip_core PUBLIC src)
|
|
39
|
+
target_link_libraries(marktip_core PRIVATE md4c)
|
|
40
|
+
set_target_properties(marktip_core PROPERTIES
|
|
41
|
+
POSITION_INDEPENDENT_CODE ON
|
|
42
|
+
CXX_VISIBILITY_PRESET hidden
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
if(MSVC)
|
|
46
|
+
target_compile_options(marktip_core PRIVATE /O2)
|
|
47
|
+
else()
|
|
48
|
+
target_compile_options(marktip_core PRIVATE -O3 -Wall -Wextra -Wpedantic)
|
|
49
|
+
endif()
|
|
50
|
+
|
|
51
|
+
option(MARKTIP_BUILD_PYTHON "Build the Python extension" ON)
|
|
52
|
+
option(MARKTIP_BUILD_WASM "Build the WebAssembly module" OFF)
|
|
53
|
+
|
|
54
|
+
if(MARKTIP_BUILD_PYTHON)
|
|
55
|
+
set(PYBIND11_FINDPYTHON ON)
|
|
56
|
+
find_package(pybind11 CONFIG REQUIRED)
|
|
57
|
+
|
|
58
|
+
if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
|
59
|
+
target_link_libraries(marktip_core PRIVATE pybind11::lto)
|
|
60
|
+
endif()
|
|
61
|
+
|
|
62
|
+
pybind11_add_module(_core
|
|
63
|
+
bindings/python/module.cpp
|
|
64
|
+
bindings/python/ast.cpp
|
|
65
|
+
bindings/python/options.cpp
|
|
66
|
+
bindings/python/markdown.cpp
|
|
67
|
+
)
|
|
68
|
+
target_link_libraries(_core PRIVATE marktip_core)
|
|
69
|
+
target_compile_definitions(_core PRIVATE MARKTIP_VERSION="${SKBUILD_PROJECT_VERSION}")
|
|
70
|
+
|
|
71
|
+
if(MSVC)
|
|
72
|
+
target_compile_options(_core PRIVATE /O2)
|
|
73
|
+
else()
|
|
74
|
+
target_compile_options(_core PRIVATE -O3 -Wall -Wextra -Wpedantic)
|
|
75
|
+
endif()
|
|
76
|
+
|
|
77
|
+
install(TARGETS _core LIBRARY DESTINATION marktip)
|
|
78
|
+
endif()
|
|
79
|
+
|
|
80
|
+
if(MARKTIP_BUILD_WASM)
|
|
81
|
+
add_library(yyjson STATIC third_party/yyjson/yyjson.c)
|
|
82
|
+
target_include_directories(yyjson PUBLIC third_party/yyjson)
|
|
83
|
+
target_compile_definitions(yyjson PUBLIC
|
|
84
|
+
YYJSON_DISABLE_WRITER=1
|
|
85
|
+
YYJSON_DISABLE_UTILS=1
|
|
86
|
+
YYJSON_DISABLE_INCR_READER=1
|
|
87
|
+
YYJSON_DISABLE_FILE=1
|
|
88
|
+
YYJSON_DISABLE_NON_STANDARD=1
|
|
89
|
+
YYJSON_DISABLE_FAST_FP_CONV=1
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
target_compile_options(marktip_core PRIVATE -fwasm-exceptions)
|
|
93
|
+
|
|
94
|
+
add_executable(marktip_wasm
|
|
95
|
+
bindings/wasm/module.cpp
|
|
96
|
+
bindings/wasm/options.cpp
|
|
97
|
+
)
|
|
98
|
+
target_link_libraries(marktip_wasm PRIVATE marktip_core yyjson)
|
|
99
|
+
target_compile_definitions(marktip_wasm PRIVATE MARKTIP_VERSION="${SKBUILD_PROJECT_VERSION}")
|
|
100
|
+
target_compile_options(marktip_wasm PRIVATE -O3 -Wall -Wextra -Wpedantic -fwasm-exceptions)
|
|
101
|
+
target_link_options(marktip_wasm PRIVATE
|
|
102
|
+
-O3
|
|
103
|
+
-fwasm-exceptions
|
|
104
|
+
--no-entry
|
|
105
|
+
-sMODULARIZE=1
|
|
106
|
+
-sEXPORT_ES6=1
|
|
107
|
+
-sENVIRONMENT=web,worker,node
|
|
108
|
+
-sALLOW_MEMORY_GROWTH=1
|
|
109
|
+
-sSTACK_SIZE=1048576
|
|
110
|
+
"-sEXPORTED_FUNCTIONS=['_malloc','_free']"
|
|
111
|
+
"-sEXPORTED_RUNTIME_METHODS=['HEAPU8']"
|
|
112
|
+
)
|
|
113
|
+
set_target_properties(marktip_wasm PROPERTIES OUTPUT_NAME marktip SUFFIX ".mjs")
|
|
114
|
+
endif()
|