Permalink
Browse files

narwhal module

  • Loading branch information...
veged committed Jan 10, 2010
1 parent d91e8a4 commit 47dd7f439f6679938333ef089b6561e1160184fa
View
@@ -1,6 +0,0 @@
-[submodule "ometa-highlighter"]
- path = ometa-highlighter
- url = git://github.com/veged/ometa-highlighter.git
-[submodule "ometa-js"]
- path = ometa-js
- url = git@github.com:veged/ometa-js.git
View
@@ -1,8 +1,9 @@
-
-all: $(patsubst %.ometajs,%.ometajs.js,$(wildcard *.ometajs))
-
-%.ometajs.js: %.ometajs
- ./ometa-js/translate.js -o $@ $?
+ometajs:
+ $(MAKE) -C src
+ -rm lib/shmakowiki.js
+ cat src/shmakowiki.js >> lib/shmakowiki.js
+ cat src/shmakowiki.ometajs.js >> lib/shmakowiki.js
+ cat src/shmakowiki2html.ometajs.js >> lib/shmakowiki.js
test:
- v8cgi tests.js
+ narwhal tests/tests.js
View
@@ -0,0 +1,3 @@
+#!/usr/bin/env narwhal
+
+require('shmakowiki/2html').main();
File renamed without changes.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,27 @@
+var file = require('file'),
+ parser = exports.parser = new (require('args').Parser)();
+
+parser.option('-i', '--input', 'inputFile')
+ .help('specifies filename to read the input source, if omit use STDIN')
+ .set();
+
+parser.option('-o', '--output', 'outFile')
+ .help('specifies filename to write the output, if omit use STDOUT')
+ .set();
+
+parser.helpful();
+
+exports.main = function () {
+ var options = parser.parse(system.args),
+ input = options.inputFile ? file.read(options.inputFile) : system.stdin.read();
+
+ if (input.charCodeAt(0) == 65279) input = input.slice(1);
+
+ var m = require('shmakowiki'),
+ result = m.ShmakoWikiToHtml.match(
+ m.ShmakoWiki.matchAll(input, 'topLevel'),
+ 'topLevel'
+ ) + '\n';
+
+ options.outFile ? file.write(options.outFile, result) : system.stdout.write(result);
+};
Submodule ometa-highlighter deleted from 9fd96e
Submodule ometa-js deleted from b26029
View
@@ -0,0 +1,37 @@
+{
+ "name": "shmakowiki",
+ "author": {
+ "name": "Sergey Berezhnoy",
+ "url": "http://github.com/veged/"
+ },
+ "description": "Yet another wiki dialect, inspired by WackoWiki and WikiCreole",
+ "keywords": [
+ "wiki",
+ "creole",
+ "wikicreole",
+ "wackowiki"
+ ],
+ "version": [
+ "0",
+ "1",
+ "1"
+ ],
+ "descriptorUrl": "http://github.com/veged/shmakowiki/raw/narwhal/package.json",
+ "packageUrl": "http://github.com/veged/shmakowiki/zipball/narwhal",
+ "packageArchive": "zip",
+ "source": {
+ "type": "github",
+ "user": "veged",
+ "packageName": "shmakowiki",
+ "descriptorUrl": "http://github.com/veged/shmakowiki/raw/narwhal/package.json",
+ "url": "http://github.com/veged/shmakowiki/zipball/narwhal",
+ "archive": "zip"
+ },
+ "contributors": [
+ {
+ "name": "Sergey Berezhnoy",
+ "url": "http://github.com/veged/"
+ }
+ ],
+ "dependencies": ["ometajs", "ometa-highlighter"]
+}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,28 +0,0 @@
-<html>
- <head>
- <script src="ometa-js/lib.js"></script>
- <script src="ometa-js/ometa-base.js"></script>
- <script src="ometa-js/parser.js"></script>
- <script src="ometa-js/bs-js-compiler.js"></script>
- <script src="ometa-js/bs-ometa-compiler.js"></script>
- <script src="ometa-js/bs-ometa-optimizer.js"></script>
- <script src="ometa-js/bs-ometa-js-compiler.js"></script>
- <script src="shmakowiki.ometajs.js"></script>
- <script src="shmakowiki2html.ometajs.js"></script>
- <script src="ometa-highlighter/ometa-highlighter.js"></script>
- <script src="ometa-highlighter/ometa-highlighter2html.js"></script>
-
- <script>
- window._ShmakoWikiToHtml = function(wiki) {
- return ShmakoWikiToHtml.match(
- ShmakoWiki.matchAll(
- wiki,
- 'topLevel'
- ),
- 'topLevel'
- );
- }
- </script>
- </head>
- <body></body>
-</html>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -0,0 +1,5 @@
+
+all: $(patsubst %.ometajs,%.ometajs.js,$(wildcard *.ometajs))
+
+%.ometajs.js: %.ometajs
+ ometajs2js -i $? -o $@
View
@@ -0,0 +1,5 @@
+var ometajs = require('ometajs'),
+ OMeta = ometajs.OMeta,
+ ohighlighter = require('ometa-highlighter'),
+ OmetaHighlighter = ohighlighter.OmetaHighlighter,
+ OmetaHighlighterToHtml = ohighlighter.OmetaHighlighterToHtml;
File renamed without changes.
Oops, something went wrong.

0 comments on commit 47dd7f4

Please sign in to comment.