Coder Social home page Coder Social logo

rbardini / metalsmith-move-up Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 172 KB

A Metalsmith plugin for moving the full contents of a directory up one or more levels.

Home Page: https://npm.im/metalsmith-move-up

License: MIT License

JavaScript 100.00%
directory folder metalsmith metalsmith-plugin move plugin

metalsmith-move-up's Introduction

Hi there ๐Ÿ‘‹

I'm Rafael, a frontend developer in the Amsterdam Area. Creator of Carteiro, a popular and highly-rated Android package tracking app in Brazil, as well as several open source projects.

Stats Top Languages by Repo Top Languages by Commit

metalsmith-move-up's People

Contributors

mcdonnelldean avatar rbardini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zml2008

metalsmith-move-up's Issues

Moving just the contents up from directory

I was wondering if there is a way that I can move just the contents one (or more) levels up from a directory.
For example:
| main folder
| โ€“ โ€“ 1.jpg
| โ€“ โ€“ subfolder
| โ€“ โ€“ | โ€“ โ€“ 2.jpg

In this instance I would like to move 2.jpg into the main folder so it would become:
| main folder
| โ€“ โ€“ 1.jpg
| โ€“ โ€“ 2.jpg
| โ€“ โ€“ subfolder

Is this possible? Thanks

Check if plugin works with metalsmith cli

This has not been checked and may require #2 to be completed first.

  • Check if it works as is
  • Document changes needed
  • Update code to work with metalsmith CLI
  • Update tests and docs as applicable

Support more input options for params

Options for metalsmith-move-up are currently supported as such:

moveUp(patternOne, patternTwo, patternN)

Add the ability to support array input:

moveUp([patternOne, patternTwo], patternN, [patternX, patternY])

Input order should be maintained.

Add common patterns / recipies to documentation

The Globbing syntax is not the easiest in the world, it would be nice to add some documentation and / or code samples to show how to do various common tasks with moveup, for instance:

  • Flatten the whole destination folder
  • Match only a single folder
  • Match all files of a single type
  • Match all files with the same partial name
  • Negate matches
  • Match by conditional or filtered pattern

Improve options / field naming

The naming is confusing in it's current format, the new suggested format is:

  • moveUp supports one or more Transforms
  • moveUp, by itself does not have any options.
  • Transforms can be provided as an collection or an individual Transform
  • Transforms have two fields, pattern & upBy
    • pattern: a glob or glob array
    • upBy: the count of directories to move up

These changes need to be reflected in the code, tests and documentation.

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.