Git Product home page Git Product logo

cli's Introduction

Shower Presentation Template

Test status

Shower logo

Shower ['ʃəuə] noun. A person or thing that shows.

  1. Built on HTML, CSS and vanilla JavaScript.
  2. Works in all modern browsers.
  3. Themes are separated from engine.
  4. Fully keyboard accessible.
  5. Printable to PDF.

See it in action. Includes Ribbon and Material themes, and core with plugins.

Follow @shower_me for support and updates, file an issue if you have any.

Quick Start

  1. Download and unzip shower.zip template archive.
  2. Open index.html in any text editor and start creating your presentation.

Quick Start via CLI

You’ll need Node.js installed on your computer.

  1. Install Shower CLI utility: npm install -g @shower/cli.
  2. Create your presentation: shower create.

Read more on shower/cli page.

Quick Start with Hosting

You’ll need Node.js installed on your computer.

  1. Copy this repository to your account via GitHub.
    1. Open import page.
    2. Use https://github.com/shower/shower for the repository URL
    3. Use your presentation name.
    4. Clone the resulted repository to your computer.
  2. Install dependencies npm install and start a local server npm start.
  3. Start editing your slides with live-reload.

Once you’re done you can build a clean copy of your slides:

npm run bundle

You’ll find your presentation in bundled folder. You can also run npm run archive to get the same files in presentation.zip.

Publish your presentation online by running:

npm run publish

You’ll have your slides published to https://USER.github.io/REPO/.

Deploy to Netlify

By clicking the button below you can fork this repo and deploy it to Netlify.

Deploy to Netlify

By doing this you would get a GitHub repo linked with Netlify in a way any change to the repo would trigger a Shower rebuild and deploy to Netlify servers, which allows for an easy way to create and share Shower presentation without the need to install anything locally.

Browser Support

Latest stable versions of Chrome, Edge, Firefox, and Safari are supported.

Contributing

You’re always welcome to contribute. Fork project, make changes and send it as pull request. But it’s better to file an issue with your idea first. Read contributing rules for more details.

Main contributors in historical order: pepelsbey, jahson, miripiruni, kizu, artpolikarpov, tonyganch, zloylos, zloylos, shvaikalesh.


Licensed under MIT License.

cli's People

Contributors

andriyor avatar avdeev avatar dkrasiev avatar igsekor avatar kostyabushuev avatar numminorihsf avatar semigradsky avatar skrylnikov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Add options from `create` task

  • --install — to install dependencies or not
  • --git — init fir repo:
    • init repo;
    • create .gitignore:
    • add repo info to package.json:
    • if there is a link to the remote repository, insert it into the badge Fork me on GitHub.

Template download mechanism

Now I just download publicly available `shower ' for every new project.zip ' and unpack it to the desired folder.

This mechanism has 3 big problems:

  1. The format of the `.zip ' hard and long to unpack inside node
  2. You cannot find the version of the template, and this prevents it from being cached
  3. You cannot verify the integrity of a downloaded or cached template

To solve this one would be:

  1. To collect not only zip but a tar archive. Node has powerful tools for working with tar archives.
  2. Generate and put next to `meta ' files.json ' in which to specify the template version, checksum and any other information. This allowed to create a caching tool (taking into account the cache update to new versions), and also to check that the download was correct

Ask if you need to install dependencies

During the creation of a new presentation, the CLI automatically sets the dependencies. You need to ask the user if they want to install dependencies now.

If you choose not to install dependencies, you still need to add them to the package.json.

For example, eslint-cli works on initialization.

Config for shower

Since version 2.0 the main functions are implemented: create, archive, prepare, save, publish and pdf. Each of these functions can be configured, for example, for prepare, you can specify the folder in which the project will be built and for pdf file name. Now these parameters are set by default and can be overridden by flags. But it's not flexible enough. What if I want a pdf file always called best_press.pdf or rename index.html in presentation.html?

The second problem is that some functionality is not needed by everyone, but would be useful in the form of plugins, such as code highlighting

I propose to look at the solution from webpack@4 and implement a configuration file for presentations, as shower.config.js. In order not to overcomplicate projects, if the config is not set, the default settings will be used, but if additional features are required, the user can flexibly configure the project.

Wrong ratio 5/3

image

It supposed to be 4/3. And I’d rather list it as 4:3 and 16:9, as it’s a bit more commonly used.

Add acceptance tests for all tasks.

Now the work of tasks is tested manually before publishing a new version. To avoid regression and broken releases, acceptance tests are needed for all tickets.l

File not found error in 0.2.3

Steps to reproduce:

shower create
cd slides
shower prepare

Output:

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: File not found with singular glob: /Users/pepelsbey/Desktop/slides/node_modules/shower-lib/shower.min.js (if this was purposeful, use `allowEmpty` option)
    at Glob.<anonymous> (/Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/glob-stream/readable.js:84:17)
    at Object.onceWrapper (events.js:273:13)
    at Glob.emit (events.js:182:13)
    at Glob._finish (/Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/glob/glob.js:197:8)
    at done (/Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/glob/glob.js:182:14)
    at Glob._processSimple2 (/Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/glob/glob.js:688:12)
    at /Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/glob/glob.js:772:12)
    at lstatcb_ (/Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/glob/glob.js:764:12)
    at RES (/Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/inflight/inflight.js:31:16)
Emitted 'error' event at:
    at Pumpify.emit (events.js:182:13)
    at Pumpify.Duplexify._destroy (/Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/duplexify/index.js:191:15)
    at /Users/pepelsbey/.nvm/versions/node/v10.11.0/lib/node_modules/shower-cli/node_modules/duplexify/index.js:182:10
    at process._tickCallback (internal/process/next_tick.js:61:11)

Maybe we should have some tests that would run and check basic functions before allowing project to be published to npm? Otherwise it breaks too often and it’s hard to rely on such tool :(

When I publish theme updates with np utility, it runs tests first. It allows updates to be published to npm only if they pass.

Run commands directly for easy automatisation

My suggestion is dealing with an issue to run commands in terminal without any steps to setup slides.

Shower CLI is pretty good interface to create and manage a presentation! I was absolutely happy with this tool any time before. But...

I want to build up a new layer under Shower CLI. It will be an extension for VS Code for managing a presentation in this IDE. I want to use Shower CLI for commands but it is impossible. I'll try to describe on an example of one command for clarification. Command shower create is constructed as a master for own settings and fast command for default settings. It will be much more relevant to my case if shower create will be able to setup theme and ratio via parameters, e.g. --theme and --ratio. It will be suitable for any cases are connected with bash scripts and any high-level tools based on Shower CLI as my own.

I will be happy to become a contributor to make this feature. Also I'm thinking seriously about support of any other repository's issues in the list. I'm trying to be useful.

Is it possible to answer me on suggestion which I've described above?

@nikolay-govorov @pepelsbey

commands don't work on windows 10

I installed the shower-cli and shower globally. When I want to create a presentation by shower create it doesn't happen.

image

Other commands have the same
PowerShell has the same as cmd

Rename installed package to shower

Just like many CLI tools do: grunt-cli becomes grunt, the same applies to Gulp and many others. It’s much easier to type shower instead of shower-cli.

Cannot overwrite existing folder

Steps to reproduce:

  1. shower create semantics
  2. Wait…
  3. shower create semantics
  4. Do you want to overwrite it? Yes
~/Documents/Пепелсбей.net/Сайт/pres
$ shower create semantics
? The semantics dir already exists. Do you want to overwrite it? Yes
shower create [<directory>]

- Create a new project

Positionals:
  directory

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Error: Cannot delete files/folders outside the current working directory. Can be overriden with the `force` option.
    at safeCheck (/Users/pepelsbey/.nvm/versions/node/v10.10.0/lib/node_modules/shower-cli/node_modules/del/index.js:18:9)
    at mapper (/Users/pepelsbey/.nvm/versions/node/v10.10.0/lib/node_modules/shower-cli/node_modules/del/index.js:33:4)
    at Promise.resolve.then.el (/Users/pepelsbey/.nvm/versions/node/v10.10.0/lib/node_modules/shower-cli/node_modules/p-map/index.js:46:16)

Disable UI and notifications

I doubt anyone needs BrowserSync’s UI page and “Browsersync: connected” message every time page opens or reloads. Options to disable:

ui: false,
notify: false

screenshot 2018-09-20 at 16 41 10

PDF built in undefined

$ shower pdf
  ✔ Creating PDF in progress
PDF built in undefined 🎉 [in 2s]
$ shower --version
0.2.4

Project and template code style

It’s different from the one used in shower-core’s JS, shower’s and theme’s HTML. Mostly it’s 2 spaces vs. 4 spaces difference, but HTML is also formatted in a different way.

I’d keep it consistent throughout the whole project, if you don’t mind. Because now when I run shower create I see your code style, not Shower’s one.

List available command options

…if there’s an empty or unrecognized command passed. Just like all good utils do instead of blaming you for something. In the future it should become a short version of help command, more on that in a separate issue.

$ shower create unable to create

Hi, I try to use shower cli to create a new slides, however it stuck there and my cpu goes to 100% for the @shower/cli process.

Here's the debug:

➜ node -v
v14.2.0

➜ npm -v
6.14.4

➜ yarn -v
1.22.4

➜ NODE_DEBUG=* shower create a
...
ESM 84649: Storing file:///Users/user/.config/yarn/global/node_modules/execa/lib/command.js in ModuleMap
ESM 84649: Storing file:///Users/user/.config/yarn/global/node_modules/execa/index.js in ModuleMap
ESM 84649: Storing file:///Users/user/.config/yarn/global/node_modules/@shower/cli/core/lib/npm.js in ModuleMap
ESM 84649: Storing file:///Users/user/.config/yarn/global/node_modules/@shower/cli/core/command/create.js in ModuleMap

Do you have any idea what might went wrong here?

Slide size’s not correct and hard-coded

page.pdf({ path: file, width: '960px', height: '600px' }))

It used to be 1024×640 (16:10) according to @page rule, so it wasn’t already the right one. But since Ribbon 3.0 and Material 2.0 are 16:9 by default, meaning 1024×576. But it also could be changed to 1024×768 (4:3), 1024×1024 (1:1) or any other ratio and it should be somehow detected by printing script. There are --slide-width and --slide-ratio variables available on .shower element.

Currently, it produces white bars:

image

I suggest we should detect current slide size before printing it.

evalCalcExpression is not defined

$ shower pdf
☐  pending   Creating PDF in progress
Error: Evaluation failed: ReferenceError: evalCalcExpression is not defined
    at Promise (__puppeteer_evaluation_script__:6:7)
    at new Promise (<anonymous>)
    at __puppeteer_evaluation_script__:1:8
    at ExecutionContext.evaluateHandle (/Users/pepelsbey/.nvm/versions/node/v10.9.0/lib/node_modules/shower-cli/node_modules/puppeteer/lib/ExecutionContext.js:98:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)
✔  success   PDF built in 'presentation.pdf' [in 2s]
…
$ shower --version
0.1.3

Add the lang option

Something like this:

<!DOCTYPE html>
<html lang="<%= lang %>">

It’s important to have a proper language set.

Using with NPX

Can we use shorter command for creating new slides?

npx shower/cli create my-slides

Inspired by CRA

Smarter PDF export

Currently the only entry point for CLI is the index.html. In my case I often have multiple versions of my slides:

andersen.html
codefest.html
fwdays.html
yandex.html

It would be good if CLI could do the following:

  • Look for *.(html|htm) file in the root
  • If there’s only one found, just print PDF with the name of this file: index.pdf, not presentation.pdf like it does right now. You don’t expect presentation name because you don’t use it anywhere.
  • If there are multiple files, list all of them and ask which one to print, just like it does for the themes.

@nikolay-govorov what do you think?

Inherit shower-core ESLint config

It would be good to have common JS code style throughout the whole organization.

If you don’t mind, I’d suggest using ; and 4 spaces, just like we do in .eslintrc.yml of shower-core, the main code base of the Shower project. It’s basically airbnb-base with some extras. The same, but in a form if .editorconfig and .stylelintrc exists in both themes.

We can always discuss details, but having a common code style is essential for a project like this.

Hardcode should be removed

`but this version of @shower/cli requires Node ${chalk.bold(pkg.engines.node)}.\n` +

Why do you hardcode it?
but this version of ${pkg.name} requires Node ${chalk.bold(pkg.engines.node)}.\n — do it like this.
Hardcode is bad practice.

Use theme’s built-in index.html page as a starting point

Currently the tools itself contains a template with a single slide. It doesn’t work already for the Material theme that contains some special markup for the badge:

<footer class="badge">
  <a href="https://github.com/shower/shower">
  <svg width="81" height="79" viewBox="0 0 81 79" aria-hidden="true">
    <path d="M40.5 0a40.5 40.5 0 0 0-12.8 78.93c2 .37 2.76-.88 2.76-2s0-3.51-.05-6.89c-11.27 2.45-13.64-5.43-13.64-5.43-1.84-4.68-4.5-5.92-4.5-5.92-3.68-2.51.28-2.46.28-2.46 4.06.29 6.2 4.17 6.2 4.17 3.61 6.19 9.48 4.4 11.79 3.37a8.65 8.65 0 0 1 2.57-5.41c-9-1-18.45-4.5-18.45-20a15.65 15.65 0 0 1 4.17-10.87 14.57 14.57 0 0 1 .4-10.72s3.4-1.09 11.14 4.15a38.39 38.39 0 0 1 20.28 0c7.73-5.24 11.13-4.15 11.13-4.15a14.55 14.55 0 0 1 .4 10.72 15.63 15.63 0 0 1 4.16 10.87c0 15.56-9.47 19-18.49 20 1.45 1.25 2.75 3.72 2.75 7.5v11.11c0 1.08.73 2.34 2.78 1.95A40.51 40.51 0 0 0 40.5 0z"/>
  </svg>
  Fork me<br>on GitHub
  </a>
</footer>

image

Unfortunately it’s not Zen Garden and everything couldn’t be achieved only via CSS.

Also a lot of people are not aware of built-in features and giving all of them by default would really help.

Update paths for template and themes

We’re in the process of moving packages from shower-package to @shower/package structure. The latest theme releases are already published exclusively to @shower/ribbon and @shower/material. Shower’s gulpfile is also got updated accordingly to prepare && archive properly.

I guess shower-cli needs the same update.

Correctness of reference information.

I need help. I speak English rather badly, and it is necessary to check whether I have made mistakes in the documentation or reference information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.