bespokejs / generator-bespoke

Create Bespoke.js presentations using Yeoman.
http://markdalgleish.com/projects/bespoke.js/
MIT License
195 stars 25 forks source link

v3 roadmap #36

Closed hsablonniere closed 7 years ago

hsablonniere commented 8 years ago

Hi everyone,

We're working on a new version of this generator and your help is welcomed. Yeah :tada::tada: !

You can see the proposed changes in the v3 branch.

Why?

The main goals of this v3 are :

The current PDF generation is done with davidmarkclements/bespoke-pdf and davidmarkclements/bespoke-to-pdf. It uses a NW.js app which itself uses an old Webkit engine :disappointed:.

We want authors to be able to use the latest CSS techniques if they want like flexbox and object-fit. In order to do so, we will remove the PDF option in the generator and push authors to use up-to-date projects like astefanutti/decktape.

We need to make sure that this kind of project stays compatible with this generator and the bespoke ecosystem in general.

Bespoke plugins as default

A lot of the gulp/build dependencies need to be updated or removed.

For now, only Jade is supported :cry:.

mojavelinux commented 8 years ago

Great plan, @hsablonniere!

mojavelinux commented 8 years ago

I'll explain Hubert's comment about bespoke-scale. We are planning to replace this plugin with the soon to be created bespoke-max. The reason are two-fold:

  1. We want a name that fits better for what the plugin does, which is to maximize the slides within the viewport
  2. When using the scale transform method, we want to apply it to a container that wraps the whole deck instead of each individual slide so that we don't introduce a new statcking context per slide and break z-index (see https://tiffanybbrown.com/2015/09/css-stacking-contexts-wtf/index.html)
  3. We may want to stop using zoom because it's a proprietary CSS property and causes a lot of inconsistency in font rendering between browsers (esp WebKit).
mojavelinux commented 8 years ago

gulp-browserify seems deprecated. We will have to update to the new gulp+browserify way.

For an example of how it's done now, see https://github.com/opendevise/presentation-bespoke-starter/blob/3ea129b1b96e769b3636dac8fbfc811263afa70a/gulpfile.js#L22-L33. There's a link to an article about this migration in a comment within that line range.

mojavelinux commented 8 years ago

Replace bespoke-theme-cube with basic styles in the generated code.

:+1: The generator should encourage best practices. Using a rotating cube is not a very accessible way to give a presentation. The audience focuses more on the cube effect than they do on the content. The default theme should be something that makes the content the focus of the presentation.

markdalgleish commented 8 years ago

@mojavelinux so true—I only ever used the cube styles when Bespoke.js itself was the presentation topic: http://markdalgleish.com/presentations/bespoke.js

mojavelinux commented 8 years ago

If we did have a default from the existing set, I'd say most people like the Nebula theme. But I think we can create one that's even more fundamental that will provide a good hackable starting point. I'd also like to use that theme for the demos across the various plugins (where applicable) so we have some consistency there. (For example: http://opendevise.github.io/bespoke-fullscreen/)

mojavelinux commented 8 years ago

I've reviewed the v3 branch. Overall, it looks really nice. A major step forward.

I sent a PR containing a handful of improvements. See #37.

Here are some additional items I'd like to see addressed when using AsciiDoc as the template language:

hsablonniere commented 8 years ago

@mojavelinux I'm almost done. I still miss the themes and I'm not sure what to do about that. I also did not updated the tests since I also don't really know what we're aiming for.

mojavelinux commented 8 years ago

Very good. I just don't think we should worry about the themes just yet. What's important is to lay down a good foundation project and keep that maintained. Most users are going to customize the styles anyway, which we encourage, so the focus is on creating a functional, hackable project.

hsablonniere commented 8 years ago

Hey @tiste, @mghignet, @NicolasGeraud, @antoinesd, Gillespie59 !! If you have some time to try this v3 and give a few feedbacks it would be awesome...

hsablonniere commented 8 years ago

@mojavelinux Should we use this.spawnCommand described here : http://yeoman.io/authoring/dependencies.html instead of simple execSync ?

hsablonniere commented 8 years ago

@mojavelinux Right now my "smoke" tests verify that :

Do we need more? Stuffs like :

hsablonniere commented 8 years ago

I had to migrate travis to a node v4. I was unable to properly spawn and kill processes (gulp and npm) with v0.10.x.

Build is now green ;-)

mojavelinux commented 8 years ago

Green bar!

mojavelinux commented 8 years ago

Where does the test application get created when I run npm test? I'm thinking perhaps we should have a section in the README that talks about the tests, how to run them, and what to expect. Also, we should mention that the tests required Node v4+.

mojavelinux commented 8 years ago

I think I know the answer. The sample project is generated into a random folder name inside the current user's temporary folder.

mojavelinux commented 8 years ago

One minor thing. When generating an AsciiDoc presentation, the final message says:

I'm all done. Running npm install for you to install the required dependencies. If this fails, try running the command yourself.

It doesn't mention that it's running the bundle command.

mojavelinux commented 8 years ago

We need to put somewhere that the following command should be run before running yo bespoke if you are generating an AsciiDoc-based presentation:

rvm use default

We can't do this in the generator because not everyone uses RVM. By doing this, it ensures the bundler gem gets installed in the correct place.

mojavelinux commented 8 years ago

The bullets plugin needs to be configured differently when creating an AsciiDoc-based presentation to align with how the Asciidoctor Bespoke converter works.

The configuration should look like this: https://github.com/opendevise/presentation-bespoke-starter/blob/asciidoc/src/scripts/main.js#L20

This also means changing the lists to:

[%build]
* one
* two
* three

More details can be found in the README for Asciidoctor Bespoke.

mojavelinux commented 8 years ago

The classes plugin should come first in the plugin list:

bespoke.from('article', [
  classes(),
  nav(),
  ...
]);

Almost all the plugins rely on the classes plugin, so it needs to be first to ensure the deck is initialized correctly.

mojavelinux commented 8 years ago

I think the extern plugin should always come last.

mojavelinux commented 8 years ago

To ensure we match the right element as the deck, and we don't include any children which are not slides, I think we should use the long-form version of the deck initializer:

bespoke.from({ parent: 'article.deck', slides: 'section' }, [
  ...
]

wdyt?

strugee commented 7 years ago

@mojavelinux specific to your last question, seems reasonable. In general I think it's better to err on the side of caution - the author can remove the "safety net" if it's really that ugly

More generally, I came here to suggest that v3 be put on npm since it seems like work on it has kinda stagnated - at a certain point it's better to just declare a project "ready" and push the remaining changes to the next major release. Slightly more frequent semver-major changes aren't the end of the world, and in the meantime, everyone will benefit from the work that's already been done.

mojavelinux commented 7 years ago

Yes, I agree we are ready to move forward. I discussed it with @hsablonniere and we had agreed, but the end of the year / beginning of the new year threw a wrench in forward progress. Make no mistake, we're using this daily / weekly, but we're cheating by using the v3 branch.

There are three things I'd like to see changed before release:

If you think any of these can be deferred, don't hesitate to suggest. We'd certainly appreciate the help to move this forward.

The clean task is the most grave since this race condition can lead to the build output being deleted immediately after it is created.

strugee commented 7 years ago

@mojavelinux gotcha. I have v3 installed locally, too :)

Those changes make sense; I might take a crack at them if I have some time. That being said, WRT the clean task, I'm not 100% sure but I think it's possible to have Gulp pass you a callback to be called when you're done with whatever. That would let us avoid nasty sync IO.

strugee commented 7 years ago

copy custom fonts by default

What do you mean by this? You mean if the user adds custom fonts they should be picked up automatically?

move base styles to a separate file so user has a blank file for creating styles (eventually, we want the base styles to come from a package)

About to send a PR for this one.

mojavelinux commented 7 years ago

You mean if the user adds custom fonts they should be picked up automatically?

Correct. In the fonts directory adjacent to images. Just about any well-designed presentation is going to use a custom font. You could link to Google Fonts, but then the presentation depends on an internet connection, which never works prior to walking on stage.

mojavelinux commented 7 years ago

I'm not 100% sure but I think it's possible to have Gulp pass you a callback to be called when you're done with whatever. That would let us avoid nasty sync IO.

While that's true, it can't block subsequent tasks. The way the delete task is wired in, it's intended to be a sync operation...otherwise it doesn't make much sense.

Here's how I did it. Pretty straightforward:

  return del.sync('dist');

(same for other other delete operations).

Of course, I really question whether clean should be wired to every task anyway. That seems like a bad practice. Output files should only be cleaned if the user requests it (or we do it intelligently).

mojavelinux commented 7 years ago

To clarify, what it breaks is the following:

gulp clean build
strugee commented 7 years ago

Why does v3 generate a README.adoc instead of README.md? Markdown is far more widely used... it doesn't really make sense to me.

mojavelinux commented 7 years ago

Because we are fans of AsciiDoc.

strugee commented 7 years ago

Shouldn't the generator try to appeal to the widest range of users, though?

I wonder if we could make this a "hidden option" through environment variables or something. Or we could make the first question ask how many questions the user wants to be asked.

mojavelinux commented 7 years ago

I'm firm on this one. I believe AsciiDoc is a better choice for our users and I want to stick with it. It renders just as well on GitHub and thus serves the purpose just fine. If the user of the generator wants to change it afterwards, it's a very straightforward change.

mojavelinux commented 7 years ago

I don't mean to be so tough about it, but this is the direction I decided to take for this generator. I'd rather focus on discussions about improving the generator's capabilities.

strugee commented 7 years ago

OK. I disagree, but it's definitely your call. It's not a big deal for me to just maintain a private fork with this change (rebasing from time to time), anyway.

mojavelinux commented 7 years ago

AsciiDoc is far superior to Markdown and will eventually overtake it if I have anything to do with it. Markdown only enjoys a lead right now because AsciiDoc had no one advocating for it at the time. Users enjoy AsciiDoc far more. This is why I push for it so hard.

mojavelinux commented 7 years ago

Version 3.0.0 is now tagged. We are waiting on permissions to publish, but that should happen shortly after this comment is posted.