-
Notifications
You must be signed in to change notification settings - Fork 188
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
Create a statically linked ELF/PE/Mach-O binary #259
Comments
I'm currently using this script (written in TypeScript) to generate the HTML slides (executed using // Drives the creation of the Reveal.js presentation using
// the asciidoctor-reveal.js JavaScript library.
import * as asciidoctorLib from 'asciidoctor.js';
import * as asciidoctorRevealjs from 'asciidoctor-reveal.js';
import * as fs from 'fs';
import * as path from 'path';
// Check that there is a parameter
if (process.argv.length < 3) {
console.error('build.ts: Missing "filename" parameter. Exiting');
process.exit(1);
}
// Check that the parameter points to a file that exists
const filename = process.argv[2];
const filepath : string = path.join(__dirname, '..', filename);
if (!fs.existsSync(filepath)) {
console.error('build.ts: The path "%s" is invalid. Exiting.', filepath);
process.exit(1);
}
// Drive the transformation from Asciidoc to HTML
const asciidoctor = asciidoctorLib();
asciidoctorRevealjs.register();
const options = {safe: 'safe', backend: 'revealjs'};
asciidoctor.convertFile(filename, options); |
I think this goal was achived through the merger of #254. The current
There's even a way to do so from PowerShell. Can I close this? |
After discussing with @Mogztter, I understand now what this aims to do. Updated the title of the ticket accordingly. Still aiming to achieve that shortly. |
Is the proposed solution different from nexe? If so, which one offers the better solution? |
Is that an AsciiDoc link... 🤣 To be honest, I don't quite understand the key differences... there is also mention of https://github.com/pmq20/node-packer |
After 3 tries I finally got it right.
It was the first tool I had come across that proposed to do something like this. This seems to be the conclusion to that issue:
|
So to answer my question, basically the same. Hard to say exactly which one is better, but we can't go wrong it seems. |
|
Plus! |
@obilodeau Do you want to give it a try? I might work on it tomorrow unless you want to experiment with Let me know if you have any questions. |
I started but I have to go. Should I name the binary Also, |
I prefer
That's completely fine since it's not mandatory to put this file in a {
"bin": {
"asciidoctor-revealjs": "npm/asciidoctor-revealjs",
"asciidoctor-reveal.js": "npm/asciidoctor-revealjs"
},
"files": [
"npm/asciidoctor-revealjs"
],
} |
Trying to create binaries with
Thinking about it, it kind of make sense since However, I tried specifying "pkg": {
"scripts": ["dist/main.js", "node_modules/@asciidoctor/**/*.js"]
} and it didn't work either. I'm starting to think that |
Ok, I got it to work. I needed to create a I think I have no other choice than to have a new I'll commit the ugly stuff but @Mogztter if you have any suggestion on cleaning it up I'm all ears. |
Ok, I think I made it better after all. I initially had a copy of the whole Opal generated code that I could remove with: module.exports = require('@asciidoctor/reveal.js') (inspired by your code again) The only thing is the need to maintain two |
The above 3 comments should have been on the PR #308. My mistake. |
I think it would be useful to add a binary in the npm package. If we do that, we would be able to execute the Reveal.js converter using
npx
:If we decide to publish a package with the same name as the command, then the command would be:
Of course it would also be possible to install the package with
npm
:The text was updated successfully, but these errors were encountered: