Code Monkey home page Code Monkey logo

Comments (5)

pseusys avatar pseusys commented on September 7, 2024

There are few important things you should know this to become clear to you:

  1. Path passed with output parameter is relative to the path! That's not stated in documentation, neither it is obvious.
  2. Considering my example, all of my files were be named: "[FILENAME]-Page-N.png", where:
    1. [FILENAME] is the original file name (without extension).
    2. Page is literally the word page (OR its translation to some language, in my case it was sometimes english sometimes russian).
    3. N is the page number. Regularily, for ordinary .drawio diagrams, it will be 1.

Finally I had to use the following steps combination in order to achieve my original goal:

- name: Render .drawio Files
  uses: rlespinasse/drawio-export-action@v2
  with:
      format: png
      path: assets
      output: .
      action-mode: all

# WARNING! This step implies all of the .drawio sources are ONE PAGE diagrams only!
- name: Rename Files
    run: for f in assets/*.png; do mv "$f" "$(echo "$f" | sed 's/-.\+-[0-9]\+//g')"; done

from drawio-export-action.

pseusys avatar pseusys commented on September 7, 2024

I would also ask the developer for a few improvements, if they will be considered valueable:

  1. Update documentation to make clear output parameter is relative to path.
  2. Set the default output value to "." (for simplicity reasons).
  3. Add script, renaming output files, containing only one page and removing the -Page-\d+ name part.
    I could've helped you providing pull request if you find any of these proposals useful!

from drawio-export-action.

rlespinasse avatar rlespinasse commented on September 7, 2024

Thanks for the report.

  1. The documentation needs some rewrites to make clear some behaviors built on top of the export feature for the Drawio Desktop app.
  2. The default value for output will remain export to avoid breaking changes in this version. Will consider updating the default value in the next major version. The next documentation should make clearer how this works.
  3. An option already exists for that: https://github.com/rlespinasse/drawio-export-action#remove-page-suffix, which can be considered to be set to true in the next major version.

from drawio-export-action.

pseusys avatar pseusys commented on September 7, 2024

Oh, great news about the option! Thanks a lot!

from drawio-export-action.

github-actions avatar github-actions commented on September 7, 2024

🎉 This issue has been resolved in version 2.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

from drawio-export-action.

Related Issues (11)

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.