1
0
mirror of https://github.com/typemill/typemill.git synced 2025-04-21 04:21:56 +02:00

Version 1.2.15: Math refactored

This commit is contained in:
Trendschau 2019-06-05 07:07:14 +02:00
parent 3fce3a5c61
commit 3a3860938d
23 changed files with 100 additions and 218 deletions

2
cache/lastCache.txt vendored
View File

@ -1 +1 @@
1559660578
1559707094

16
composer.lock generated
View File

@ -652,7 +652,7 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
@ -823,16 +823,16 @@
},
{
"name": "twig/twig",
"version": "v1.41.0",
"version": "v1.42.1",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "575cd5028362da591facde1ef5d7b94553c375c9"
"reference": "671347603760a88b1e7288aaa9378f33687d7edf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/575cd5028362da591facde1ef5d7b94553c375c9",
"reference": "575cd5028362da591facde1ef5d7b94553c375c9",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/671347603760a88b1e7288aaa9378f33687d7edf",
"reference": "671347603760a88b1e7288aaa9378f33687d7edf",
"shasum": ""
},
"require": {
@ -842,12 +842,12 @@
"require-dev": {
"psr/container": "^1.0",
"symfony/debug": "^2.7",
"symfony/phpunit-bridge": "^3.4.19|^4.1.8"
"symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.41-dev"
"dev-master": "1.42-dev"
}
},
"autoload": {
@ -885,7 +885,7 @@
"keywords": [
"templating"
],
"time": "2019-05-14T11:59:08+00:00"
"time": "2019-06-04T11:31:08+00:00"
},
{
"name": "vlucas/valitron",

View File

@ -10,7 +10,7 @@ If you face any problems, then please make sure, that your system supports these
- Apache server.
- The module `mod_rewrite` and `htaccess`.
If you run a linux-system like Debian or Ubuntu, then please double check that `mod_rewrite` and `htaccess` are activated. Check this [issue on GitHub](https://github.com/trendschau/typemill/issues/16) for help.
If you run a linux-system like Debian or Ubuntu, then please double check that `mod_rewrite` and `htaccess` are activated. Check this [issue on GitHub](https://github.com/typemill/typemill/issues/16) for help.
Please make the following folders writable with permission 774 (you can use your ftp-software for it):
@ -19,5 +19,5 @@ Please make the following folders writable with permission 774 (you can use your
- Media
- Settings
If you still get an error, then you can post an issue on [GitHub](https://github.com/trendschau/typemill).
If you still get an error, then you can post an issue on [GitHub](https://github.com/typemill/typemill).

View File

@ -1,6 +1,6 @@
# Write Content
Typemill is a simple Flat File Content Management System (CMS). We work hard to provide the best author experience with easy and intuitive authoring tools. But Typemill is still in early development and it is likely that not everything will work perfectly out of the box. If you miss something or if you have ideas for improvement, then let me know via mail (trendschau@gmail.com) or via [GitHub](https://github.com/trendschau/typemill/issues).
Typemill is a simple Flat File Content Management System (CMS). We work hard to provide the best author experience with easy and intuitive authoring tools. But Typemill is still in early development and it is likely that not everything will work perfectly out of the box. If you miss something or if you have ideas for improvement, then let me know via [GitHub](https://github.com/typemill/typemill/issues).
## The Navigation

View File

@ -2,7 +2,7 @@
If you need any help, then please read the [documentation on typemill.net](https://typemill.net/typemill) first. Some short video-tutorials are in work right now.
If you found a bug or if you have a question, then please open a new issue on [GitHub](https://github.com/trendschau/typemill/issues).
If you found a bug or if you have a question, then please open a new issue on [GitHub](https://github.com/typemill/typemill/issues).
Typemill is open source and a one man project right now, so please understand that I cannot provide individual support.

View File

View File

@ -1,4 +1,4 @@
# Typemill
*Typemill is a user-friendly and lightweight open source CMS for publishing text-works like prose, lyrics, manuals, documentations, studies and more. Just download and start.* edkit
*Typemill is a user-friendly and lightweight open source CMS for publishing text-works like prose, lyrics, manuals, documentations, studies and more. Just download and start.*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

View File

@ -1,13 +1,13 @@
# About TYPEMILL
TYPEMILL is a small flat file cms created for editors and writers. It provides a author-friendly dashboard and a visual-block-editor for markdown based on vue.js. Use TYPEMILL for manuals, documentations, web-books and similar publications. The website http://typemill.net itself is an example-website for TYPEMILL.
TYPEMILL is a small flat file cms created for editors and writers. It provides a author-friendly dashboard and a visual-block-editor for markdown based on vue.js. Use TYPEMILL for manuals, documentations, web-books and similar publications. The website http://typemill.net itself is an example for TYPEMILL.
![TYPEMILL Screenshot](https://typemill.net/media/demo-3.gif)
![TYPEMILL Screenshot](https://typemill.net/media/tm-toc.gif)
## Features
* Creates a website based on markdown files.
* Provides a author-friendly visual markdown editor (experimental, based on VUE.js).
* Provides an author-friendly visual markdown editor (work in progress, based on VUE.js).
* Provides a pure markdown editing mode.
* Markdown supports table of contents (TOC), tables, footnotes, abbreviations and definition lists.
* Create and sort pages with drag & drop in the navigation.
@ -15,11 +15,11 @@ TYPEMILL is a small flat file cms created for editors and writers. It provides a
* Create and manage users.
* Develop configurable plugins with the Symfony Event Dispatcher.
* Develop configurable themes with TWIG.
* Allows super easy backend and frontend forms with simple YAML-definitions.
* Allows super easy backend and frontend forms with simple YAML-files.
* Ships with a fully responsive standard theme
* Ships with plugins for
* MathJax and KaTeX, c.
* code highlighting.
* MathJax and KaTeX.
* Code highlighting.
* Matomo/Piwik and Google Analytics.
* Cookie Consent.
@ -49,7 +49,7 @@ To run TYPEMILL on a **live** system, simply upload the files to your server
## Make Folders Writable.
Make sure that the following folders and all their content are writable (permission 774 recursively):
Make sure that the following folders and all their files are writable (permission 774 recursively):
* cache
* content
@ -70,6 +70,12 @@ You can find your login screen under `/tm/login` or simply go to `/setup` and yo
You can read the full documentation for writers, for theme developers and for plugin developers on the [TYPEMILL website](http://typemill.net).
## Support
This is an open source project. I love it and I spend about 20 hours a week on it (starting in 2017). There is no business model right now, but you can hire me for implementation or simply support this project if you like.
Donate: https://www.paypal.me/typemill
## Contribute
Typemill is still in an early stage and contributions are highly welcome. Here are some ideas for non-coder:

View File

@ -195,12 +195,12 @@ abstract class ContentController
{
$contentFolder = Folder::scanFolderFlat($this->settings['rootPath'] . $this->settings['contentFolder']);
if(array_search('index.md', $contentFolder))
if(in_array('index.md', $contentFolder))
{
$md = true;
$status = 'published';
}
if(array_search('index.txt', $contentFolder))
if(in_array('index.txt', $contentFolder))
{
$txt = true;
$status = 'unpublished';

View File

@ -42,7 +42,7 @@ class PageController extends Controller
{
$structure = $this->getCachedStructure($cache);
}
else
if(!isset($structure) OR !$structure)
{
/* if not, get a fresh structure of the content folder */
$structure = $this->getFreshStructure($pathToContent, $cache, $uri);

View File

@ -1,165 +0,0 @@
<?php
namespace Typemill\Extensions;
class ParsedownMath extends \ParsedownExtra
{
const VERSION = '1.0';
public function __construct()
{
if (version_compare(parent::version, '1.7.1') < 0) {
# die('need version 1.7.1');
# throw new Exception('ParsedownMath requires a later version of Parsedown');
}
// Blocks
$this->BlockTypes['\\'][] = 'Math';
$this->BlockTypes['$'][] = 'Math';
// Inline
$this->InlineTypes['\\'][] = 'Math';
$this->inlineMarkerList .= '\\';
}
// Setters
protected $mathMode = true;
public function enableMath($input = true)
{
$this->mathMode = $input;
if ($input == false) {
return $this;
}
return $this;
}
// -------------------------------------------------------------------------
// ----------------------- Inline --------------------------
// -------------------------------------------------------------------------
//
// Inline Math
// -------------------------------------------------------------------------
protected function inlineMath($Excerpt)
{
if (!$this->mathMode) {
return;
}
// if (preg_match('/^(?<!\\\\)((?<!\\\\\()\\\\\((?!\\\\\())(.*?)(?<!\\\\)(?<!\\\\\()((?<!\\\\\))\\\\\)(?!\\\\\)))(?!\\\\\()/s', $Excerpt['text'], $matches)) {
if (preg_match('/^(?<!\\\\)(?<!\\\\\()\\\\\((.*?)(?<!\\\\\()\\\\\)(?!\\\\\))/s', $Excerpt['text'], $matches)) {
return array(
'extent' => strlen($matches[0]),
'element' => array(
'text' => $matches[0]
),
);
}
}
protected $specialCharacters = array(
'\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '<', '>', '#', '+', '-', '.', '!', '|', '~', '^', '='
);
//
// Inline Escape
// -------------------------------------------------------------------------
protected function inlineEscapeSequence($Excerpt)
{
$Element = array(
'element' => array(
'rawHtml' => $Excerpt['text'][1],
),
'extent' => 2,
);
if ($this->mathMode) {
if (isset($Excerpt['text'][1]) && in_array($Excerpt['text'][1], $this->specialCharacters) && !preg_match('/(?<!\\\\)((?<!\\\\\()\\\\\((?!\\\\\())(.*?)(?<!\\\\)(?<!\\\\\()((?<!\\\\\))\\\\\)(?!\\\\\)))(?!\\\\\()/s', $Excerpt['text'])) {
return $Element;
}
} else {
if (isset($Excerpt['text'][1]) && in_array($Excerpt['text'][1], $this->specialCharacters)) {
return $Element;
}
}
}
// -------------------------------------------------------------------------
// ----------------------- Blocks --------------------------
// -------------------------------------------------------------------------
//
// Block Math
// --------------------------------------------------------------------------
protected function blockMath($Line)
{
$Block = array(
'element' => array(
'text' => '',
),
);
if (preg_match('/^(?<!\\\\)(\\\\\[)(?!.)$/', $Line['text'])) {
$Block['end'] = '\]';
return $Block;
} elseif (preg_match('/^(?<!\\\\)(\$\$)(?!.)$/', $Line['text'])) {
$Block['end'] = '$$';
return $Block;
}
}
// ~
protected function blockMathContinue($Line, $Block)
{
if (isset($Block['complete'])) {
return;
}
if (isset($Block['interrupted'])) {
$Block['element']['text'] .= str_repeat("\n", $Block['interrupted']);
unset($Block['interrupted']);
}
if (preg_match('/^(?<!\\\\)(\\\\\])$/', $Line['text']) && $Block['end'] === '\]') {
$Block['complete'] = true;
$Block['latex'] = true;
$Block['element']['text'] = "\\[".$Block['element']['text']."\\]";
return $Block;
} elseif (preg_match('/^(?<!\\\\)(\$\$)$/', $Line['text']) && $Block['end'] === '$$') {
$Block['complete'] = true;
$Block['latex'] = true;
$Block['element']['text'] = "$$".$Block['element']['text']."$$";
return $Block;
}
$Block['element']['text'] .= "\n" . $Line['body'];
// ~
return $Block;
}
// ~
protected function blockMathComplete($Block)
{
return $Block;
}
}

View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright © 2016 Taufik Nurrohman, latitudu.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Benjamin Høegh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -43,7 +43,7 @@ class Settings
'contentFolder' => 'content',
'cache' => true,
'cachePath' => $rootPath . 'cache',
'version' => '1.2.14',
'version' => '1.2.15',
'setup' => true,
'welcome' => true,
'images' => ['live' => ['width' => 820], 'mlibrary' => ['width' => 50, 'height' => 50]],

View File

@ -18,7 +18,7 @@
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190604" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
</head>
<body>
@ -35,7 +35,7 @@
</article>
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/color-picker.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/author.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/color-picker.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/author.js?20190604"></script>
</body>
</html>

View File

@ -19,7 +19,7 @@
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190605" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
</head>
<body>
@ -29,6 +29,6 @@
{% block content %}{% endblock %}
</div>
<script src="{{ base_url }}/system/author/js/auth.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/auth.js?20190604"></script>
</body>
</html>

View File

@ -16,9 +16,9 @@
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ base_url }}/system/author/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css?20190604" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190604" />
</head>
<body>
<header class="main-header">

View File

@ -17,9 +17,9 @@
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css?20190604" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190604" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
{{ assets.renderCSS() }}
@ -39,15 +39,15 @@
</article>
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/vue.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/author.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vue-blox.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/lazy-video.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/author.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/vue-blox.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/lazy-video.js?20190604"></script>
{{ assets.renderJS() }}

View File

@ -17,9 +17,9 @@
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ base_url }}/system/author/img/apple-touch-icon-152x152.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css?20190604" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190517" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190604" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
</head>
<body>
@ -36,13 +36,13 @@
</article>
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/vue.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/author.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vue-editor.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20190517"></script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/author.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/vue-editor.js?20190604"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20190604"></script>
</body>
</html>