-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rockspec example added #2
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# package-template.sile | ||
Template repository for creating new classes or packages | ||
Template repository for creating new classes or packages |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
local plain = require("classes.plain") | ||
|
||
local class = pl.class(plain) | ||
class._name = "sample" | ||
|
||
-- This class will inherit the plain's default frameset, if you don't want so just overwrite it below | ||
-- class.defaultFrameset = { | ||
-- content = { | ||
-- left = "", | ||
-- right = "", | ||
-- top = "", | ||
-- bottom = "" | ||
-- } | ||
-- } | ||
|
||
function class:_init(options) | ||
plain._init(self, options) | ||
self:loadPackage("template") | ||
end | ||
|
||
function class:registerCommands() | ||
plain.registerCommands(self) | ||
end | ||
|
||
return class |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package = "package-template.sile" | ||
version = "dev-1" | ||
|
||
description = { | ||
summary = "A template for SILE packages...", | ||
detailed = [[]], | ||
homepage = "", -- e.g. its GitHub repo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets go ahead and fill in the blanks throughout the rockspec with working values so it can actually be built and tested from this template repo, but document each line with a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, it can actually be built this way, I had no trouble in my attempts to built and run the test functions... |
||
maintainer = "", | ||
license = "MIT" | ||
} | ||
|
||
source = { | ||
url = "", -- a clonable repository link | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I took me a while to understand why some of my GitHub packages didn't work in some cases, until someone told me I had to change my initial |
||
-- tag = "" | ||
} | ||
|
||
dependencies = {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would show an example, and the minimal one might be:
(Assuming this repository also eventually provides an adequate |
||
build = { | ||
type = "builtin", | ||
|
||
modules = { | ||
["sile.packages.template"] = "packages/template/init.lua", | ||
["sile.classes.sample"] = "classes/sample.lua", | ||
}, | ||
|
||
-- for documentation and config files | ||
copy_directories = {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
local base = require("packages.base") | ||
|
||
local package = pl.class(base) | ||
package._name = "template" | ||
|
||
function package:_init() | ||
base._init(self) | ||
end | ||
|
||
function package:registerCommands() | ||
self:registerCommand("package-command", function(_, _) | ||
end) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could minimally do a |
||
end | ||
|
||
package.documentation = [[ | ||
\begin{document} | ||
\autodoc:package{} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion (untested): Add some valid example.
|
||
\end{document} | ||
]] | ||
|
||
return package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First line should probably be
rockspec_format = "3.0"
(for compatibility)