kobo / gaiden Goto Github PK
View Code? Open in Web Editor NEWGaiden is a tool that makes it easy to create documentation with Markdown.
License: Apache License 2.0
Gaiden is a tool that makes it easy to create documentation with Markdown.
License: Apache License 2.0
I want to use a filter like Grails:
when:
// GaidenConfig.groovy or filters/*.groovy
def filters = {
def before = { String text ->
text.replaceAll(/MY_REPLACE_TEXT_1/, '**HELLO**')
}
def after = {
text.replaceAll(/<h2>MY_REPLACE_TEXT_2<\/h2>/, '<i>BYE</i>')
}
def afterTemplates = { // afterRender
text.replaceAll(/TITLE/, 'GOOD')
}
}
// hello.md
# MY_REPLACE_TEXT_1
## MY_REPLACE_TEXT_2
// layout.html
<html>
<head>
<title>TITLE</title>
</head>
<body>
$content
</body>
</html>
then:
// hello.html
<html>
<head>
<title>GOOD</title>
</head>
<body>
<h1><strong>HELLO</strong></h1>
<i>BYE</i>
</body>
</html>
Some editor use a working file having a certain prefix or suffix. Watch command should ignore it.
It might be better to be able to specify as command line arguments, e.g:
$ gaiden watch --exclude ".#*" --exclude "*~"
I think the pattern should be an Ant glob syntax or regular expression.
Feature request. Is it possible to add support for using asciidoctor as well? Thanks.
Just a nudge to upload the docs. The gvm link on the getting started page, which has been updated in the source to sdkman equivalent, leads to a dark place.
brandLogoLink = 'http://xxxxxx'
//brandLogoLink = 'index.html'
//brandLogoLink = '/index.html'
just output as <a href="SPECIFIED_VALUE">
in layout.html.
This makes it possible to link to the other markdown files using a relative or an absolute path.
like this:
gaiden -v
gaiden --version
If utime of source file <= utime of output file
is true, a build of the source file can be skipped. You would avoid time-wasting.
A path in toc.groovy is considered a absolute path from document root.
"introduction.md"(title: "Introduction") {
"introduction/whatis.md"(title: "What is Gaiden?")
"introduction/install.md"(title: "Install")
}
"quickstart/quickstart.md"(title: "Quick Start") {
"quickstart/addingcontent.md"(title: "Adding content")
}
This specification is useful if you want to construct the toc from pages which are stored in different directories. But I think you almost obey a default convention. So I want to write the above sample like this:
"introduction.md"(title: "Introduction") {
"whatis.md"(title: "What is Gaiden?") // -> introduction/whatis.md
"install.md"(title: "Install") // -> introduction/install.md
}
"quickstart.md"(title: "Quick Start") { // ->quickstart.md
"addingcontent.md"(title: "Adding content") // -> quickstart/addingcontent.md
}
$ gaiden build
Not a Gaiden project (Cannot find /tmp/gaiden/config.groovy)
Are you sure you want to continue? [y/N] y
>> my-sample.md => my-sample.html... Exception in thread "main" groovy.lang.MissingPropertyException: No such property: destPage for class: SimpleTemplateScript7
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at SimpleTemplateScript7$_run_closure1.doCall(SimpleTemplateScript7.groovy:10)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1074)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1253)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at SimpleTemplateScript5.run(SimpleTemplateScript5.groovy:9)
at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.writeTo(SimpleTemplateEngine.java:165)
at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.toString(SimpleTemplateEngine.java:177)
at org.codehaus.groovy.runtime.typehandling.ShortTypeHandling.castToString(ShortTypeHandling.java:42)
at gaiden.TemplateEngine.make(TemplateEngine.groovy:48)
at gaiden.BindingBuilder.include(BindingBuilder.groovy:117)
at gaiden.BindingBuilder.this$2$include(BindingBuilder.groovy)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1074)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1253)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at SimpleTemplateScript1.run(SimpleTemplateScript1.groovy:29)
at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.writeTo(SimpleTemplateEngine.java:165)
at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.toString(SimpleTemplateEngine.java:177)
at org.codehaus.groovy.runtime.typehandling.ShortTypeHandling.castToString(ShortTypeHandling.java:42)
at gaiden.TemplateEngine.make(TemplateEngine.groovy:48)
at gaiden.DocumentWriter.writePage(DocumentWriter.groovy:92)
at gaiden.DocumentWriter.access$0(DocumentWriter.groovy)
at gaiden.DocumentWriter$_writePages_closure1.doCall(DocumentWriter.groovy:71)
at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at groovy.lang.Closure.call(Closure.java:423)
at groovy.lang.Closure.call(Closure.java:439)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1372)
at gaiden.DocumentWriter.writePages(DocumentWriter.groovy:68)
at gaiden.DocumentWriter.write(DocumentWriter.groovy:63)
at gaiden.command.BuildCommand.execute(BuildCommand.groovy:62)
at gaiden.command.AbstractCommand.execute(AbstractCommand.groovy:73)
at gaiden.GaidenMain.executeCommand(GaidenMain.groovy:65)
at gaiden.GaidenMain.run(GaidenMain.groovy:45)
at gaiden.GaidenMain.main(GaidenMain.groovy:40)
I want to create an extension using a third party libraries.
Therefore, I'd like you to be able to read the lib
directory of PROJECT ROOT
and MY EXTENSION ROOT
Thanks in advance.
I got an error when using Java 1.6:
$ gaiden
Exception in thread "main" java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.RuntimeException do not match. Expected 5 but got 4
at groovy.lang.MetaClassImpl.selectConstructorAndTransformArguments(MetaClassImpl.java:1410)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.selectConstructorAndTransformArguments(ScriptBytecodeAdapter.java:234)
at gaiden.exception.GaidenException.<init>(GaidenException.groovy:33)
at gaiden.exception.GaidenException.<init>(GaidenException.groovy:32)
at gaiden.exception.IllegalOperationException.<init>(IllegalOperationException.groovy:30)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186)
at gaiden.GaidenMain.run(GaidenMain.groovy:55)
at gaiden.GaidenMain$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
This doesn't occur with Java 7.
It would be really nice to be able to include a description in the toc.groovy file. For example:
"some-page.md" (title: "Some page", description: "This is some page")
There is a config.groovy having:
extensions {
url "https://github.com/kobo/gaiden-column-block"
file "/tmp/my-trial-extension" // OR: url "file:///tmp/my-trial-extension"
}
A gaiden build
would automatically clone a git repository from the url
into $HOME/.gaiden/extensions
.
A file
is not important because it could be substituted by url
. It just checks the directory and added the path to extensionDirectories
. In case of url
, the directory would be copied into ./.gaiden/extensions
A refresh-extensions
command might be better like Grails.
PS D:\projects> gaiden create-project test-gaiden
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass$3$1 (file:/C:/Users/Sophie/AppData/Local/Programs/gaiden-1.1/lib/groovy-all-2.3 .6.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass$3$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Created Gaiden project at D:\projects\test-gaiden
WIN10 x64
java version "11.0.1" 2018-10-16 LTS
Edit: I'm sorry I didn't check the message again I removed the less/greater than symbols
After creating a simple project to play around with I was not able to get Gaiden to correctly use the default theme. The resource path inside the generated HTMLs points somewhere else:
"link rel="stylesheet" href="..........\css\bootstrap.min.css"
instead of
"link rel="stylesheet" href="css\bootstrap.min.css"
I tried "gaiden clean/build" with a GVM managed version of Gaiden as well as "gaidenw". No difference.
> gaiden create-project ninjagaiden
Exception in thread "main" java.lang.UnsupportedOperationException
at java.nio.file.Files.setPosixFilePermissions(Files.java:1989)
at gaiden.command.CreateProjectCommand$_execute_closure1.doCall(CreateProjectCommand.groovy:58)
and ninjagaiden
folder has these files.
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2014/09/13 23:55 wrapper
-a--- 2014/09/13 23:49 745 config.groovy
-a--- 2014/09/13 23:49 5019 gaidenw
-a--- 2014/09/13 23:49 2371 gaidenw.bat
-a--- 2014/09/13 23:49 13 pages.groovy
-a--- 2014/09/13 23:49 17 README.md
please handle UnsupportedOperationException for Windows!
note: http://waman.hatenablog.com/entry/20120525/1337900102#permission
note: my windows environment depends on posh-gvm.
following error occurs when downloading wrapper:
Exception in thread "main" java.lang.UnsupportedOperationException
at java.nio.file.Files.setPosixFilePermissions(Files.java:1991)
at gaiden.GaidenWrapper.download(GaidenWrapper.java:74)
at gaiden.GaidenWrapper.getGaidenHome(GaidenWrapper.java:61)
at gaiden.GaidenWrapper.run(GaidenWrapper.java:50)
at gaiden.GaidenWrapper.main(GaidenWrapper.java:40)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.