Comments (5)
Ok think i've tracked this one down. By checking out and opening the CodeMirror repo mode php index.html example and looking at the required javascript files I can see the following files are dependencies of the php highlighting:
codemirror.js
matchbrackets.js
htmlmixed.js
xml.js
javascript.js
css.js
clike.js
php.js
matchbrackets.js
was missed when using the http://codemirror.net/doc/compress.html
utility.
I'll recompile and submit a pull request when i get 5 minutes ๐
from wikitten.
Got all the modes working for all libraries using the following build process:
## Clone CodeMirror repo
git clone [email protected]:codemirror/CodeMirror.git
cd CodeMirror
## Make a tmp workspace
mkdir -p _all/_files
mkdir -p _all/_deps
## Copy in main lib
cd _all
cp ../lib/codemirror.js .
cp ../lib/codemirror.css .
## Copy in all modes for syntax highlighting
cd _files
cp ../../mode/*/*.js .
## Locate test files
grep -i "MT(" *
## Remove test files
rm -rf less_test.js scss_test.js test.js
## Copy in deps for some of the modes
cd ../_deps/
cp ../../addon/edit/matchbrackets.js .
cp ../../addon/mode/simple.js .
## Combine all addons and modes with main lib file
cat *.js >> ../codemirror.js
cd ../_files
cat *.js >> ../codemirror.js
## Copy to Wikitten project
cp ../codemirror.js ../../../Wikitten/static/js/codemirror.min.js
cp ../codemirror.css ../../../Wikitten/static/css/codemirror.css
Pulls in the two deps matchbrackets.js
and simple.js
used by many of the modes for highlighting helpers.
Build output:
~/Software ๎ฐ git clone [email protected]:codemirror/CodeMirror.git
Cloning into 'CodeMirror'...
remote: Counting objects: 28054, done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 28054 (delta 19), reused 2 (delta 2), pack-reused 28005
Receiving objects: 100% (28054/28054), 13.88 MiB | 1.83 MiB/s, done.
Resolving deltas: 100% (16377/16377), done.
Checking connectivity... done.
~/Software ๎ฐ cd CodeMirror
~/Software/CodeMirror ๎ฐ ๎ master ๎ฐ mkdir -p _all/_files
~/Software/CodeMirror ๎ฐ ๎ master ๎ฐ mkdir -p _all/_deps
~/Software/CodeMirror ๎ฐ ๎ master ๎ฐ cd _all
~/Software/CodeMirror/_all ๎ฐ ๎ master ๎ฐ cp ../lib/codemirror.js .
~/Software/CodeMirror/_all ๎ฐ ๎ master ๎ฐ cp ../lib/codemirror.css .
~/Software/CodeMirror/_all ๎ฐ ๎ master ๎ฐ cd _files
~/Software/CodeMirror/_all/_files ๎ฐ ๎ master ๎ฐ cp ../../mode/*/*.js .
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/css/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/gfm/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/haml/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/javascript/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/markdown/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/php/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/ruby/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/shell/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/slim/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/stex/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/textile/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/verilog/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/xml/test.jsโ
cp: will not overwrite just-created โ./test.jsโ with โ../../mode/xquery/test.jsโ
โ ๎ฐ ~/Software/CodeMirror/_all/_files ๎ฐ ๎ master ๎ฐ grep -i "MT(" *
less_test.js: function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); }
less_test.js: MT("variable",
less_test.js: MT("amp",
less_test.js: MT("mixin",
less_test.js: MT("nest",
less_test.js: MT("interpolation", ".@{[variable foo]} { [property font-weight]: [atom bold]; }");
scss_test.js: function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }
scss_test.js: MT('url_with_quotation',
scss_test.js: MT('url_with_double_quotes',
scss_test.js: MT('url_with_single_quotes',
scss_test.js: MT('string',
scss_test.js: MT('important_keyword',
scss_test.js: MT('variable',
scss_test.js: MT('variable_as_attribute',
scss_test.js: MT('numbers',
scss_test.js: MT('number_percentage',
scss_test.js: MT('selector',
scss_test.js: MT('singleline_comment',
scss_test.js: MT('multiline_comment',
scss_test.js: MT('attribute_with_hyphen',
scss_test.js: MT('string_after_attribute',
scss_test.js: MT('directives',
scss_test.js: MT('basic_structure',
scss_test.js: MT('nested_structure',
scss_test.js: MT('mixin',
scss_test.js: MT('number_without_semicolon',
scss_test.js: MT('atom_in_nested_block',
scss_test.js: MT('interpolation_in_property',
scss_test.js: MT('interpolation_in_selector',
scss_test.js: MT('interpolation_error',
scss_test.js: MT("divide_operator",
scss_test.js: MT('nested_structure_with_id_selector',
scss_test.js: MT('indent_mixin',
scss_test.js: MT('indent_nested',
scss_test.js: MT('indent_parentheses',
scss_test.js: MT('indent_vardef',
test.js: function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
test.js: MT("indent",
test.js: MT("indent_switch",
test.js: MT("def",
~/Software/CodeMirror/_all/_files ๎ฐ ๎ master ๎ฐ rm -rf less_test.js scss_test.js test.js
~/Software/CodeMirror/_all/_files ๎ฐ ๎ master ๎ฐ cd ../_deps/
~/Software/CodeMirror/_all/_deps ๎ฐ ๎ master ๎ฐ cp ../../addon/edit/matchbrackets.js .
~/Software/CodeMirror/_all/_deps ๎ฐ ๎ master ๎ฐ cp ../../addon/mode/simple.js .
~/Software/CodeMirror/_all/_deps ๎ฐ ๎ master ๎ฐ cat *.js >> ../codemirror.js
~/Software/CodeMirror/_all/_deps ๎ฐ ๎ master ๎ฐ cd ../_files
~/Software/CodeMirror/_all/_files ๎ฐ ๎ master ๎ฐ cat *.js >> ../codemirror.js
~/Software/CodeMirror/_all/_files ๎ฐ ๎ master ๎ฐ cp ../codemirror.js ../../../Wikitten/static/js/codemirror.min.js
~/Software/CodeMirror/_all/_files ๎ฐ ๎ master ๎ฐ cp ../codemirror.css ../../../Wikitten/static/css/codemirror.css
~/Software/CodeMirror/_all/_files ๎ฐ ๎ master ๎ฐ
Now there are no errors in the console:
and syntax highlighting seems to be working for php and other languages ๐
from wikitten.
Lastly minifying locally and not relying on a web based compiler:
## Install uglify-js
sudo npm install uglify-js -g
## Run the minifier
uglifyjs --compress --mangle --output test.js -- Wikitten/static/js/codemirror.min.js
## Copy resulting file into the project
cd Wikitten/static/js
mv codemirror.min.js codemirror.js
cp ../../../test.js codemirror.min.js
from wikitten.
One pull request to fix: #63
from wikitten.
I merged PR #63, thank you!
from wikitten.
Related Issues (20)
- Do Bootstrap accordions work?
- PHP 7 support? HOT 2
- pastebin็ฝ็ซไธ็็ฌ่ฎฐๅฆไฝไฝฟ็จๅข๏ผ
- one user write,and everyone can read
- ใBUGใDeprecated: Array and string offset access syntax with curly braces is deprecated in /www/wwwroot/Wikitten/renderers/Markdown/Markdown.php on line 1799
- Code Snippets HOT 1
- Uncaught Exception: Page 'index.md' was not found HOT 3
- Error 403 on saving markdown page that contains the String `/etc/`
- HTTP 200 when page doesn't exist HOT 1
- Proposal: new theme-s HOT 1
- Feature Request HOT 9
- Why is there an inconsistency between the live version and the GitHub version? HOT 3
- Major Upgrade Features Planned to make this my Evernote replacement... HOT 2
- How about disqus support?
- Nginx? HOT 2
- Req: Mermaid (via Mermaid-PHP perhaps?)
- can wikitten create table of Contents automatic?
- Index wrong on windows HOT 2
- how to customize css HOT 1
- Possible failure when running built-in php server HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wikitten.