Giter Club home page Giter Club logo

Comments (7)

h4cc avatar h4cc commented on August 17, 2024

Have you tried mix clean and then mix compile? Also a brutal rm -rf _build should work.

My local tests did not need any compile step, because of @external_resource.

from slugger.

davidcole avatar davidcole commented on August 17, 2024

I'm having the same problem. Where does the custom file go? Where is lib relative to? Nowhere seems to work, even with clearing out the build and recompiling.

from slugger.

h4cc avatar h4cc commented on August 17, 2024

Could you please show how your folder layout looks like?

When the library is installed via mix it should look somehow like this:

config/dev.exs <- Put your own config in here.
deps/slugger/lib/replacements.exs <- This is the default file
priv/slugger_replacements.exs <- This is our custom file.

Have you tried using __DIR__ in your config? Then you could make the path relative to config/.

from slugger.

LostKobrakai avatar LostKobrakai commented on August 17, 2024

I'm wondering how this should be working when using erlang releases. The packaging will result in a different path for the priv dir and using :code.priv_dir(:myapp) would not work in the config.exs.

from slugger.

h4cc avatar h4cc commented on August 17, 2024

The idea is to have a relative path from __DIR__ inside your project, what should work independent from absolute location.

from slugger.

LostKobrakai avatar LostKobrakai commented on August 17, 2024

Yeah, but a static relative path is also not present by default in an erlang release. Priv files live in lib/myapp-0.0.1/priv/, which is neither a fitting relative path in the dev environment of a mix project nor static as it's including the version of the application. In my opinion the most sane way would be to have the config be a relative path within /priv and the application name while using Path.join(:code.priv_dir(:myapp), rel_path) within slugger to build an absolute path from both.

from slugger.

h4cc avatar h4cc commented on August 17, 2024

Okay, have you tried this? Is there a error message?

Because the replacemenets.exs file is only used at compile. If a different file is used by configuration, it does not need to be inside the release because it has become code at compiletime.

This is the place: https://github.com/h4cc/slugger/blob/master/lib/slugger.ex#L84

from slugger.

Related Issues (18)

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.