Closed zentol closed 2 years ago
Do you have any syntax in mind for that? What would a solution look like?
I thought of something like this:
<CH.Code>
```java Class.java
// from {basePath}/some/path/infix/{pathSuffix)/Class.java
</CH.Code>
where `basePath` and `pathSuffix` would be set in the plugin config in some `vars` map:
{ lineNumbers: false, vars: { basePath: "some/path" pathSuffix: "some/other/path" } }
I understand, but I think this is outside of the scope of Code Hike, at least for now.
When embedding code from a file one needs to specify a relative path to said file.
Depending on the project structure and language these can become quite long, like
../../projects/project/src/main/java/my/stable/package/prefix/some/more/packagesCode.Java
This makes the .mdx files less legible, requires copying a (usually common) base path into every block, and requires changes to every referencing file if the project structure changes.
This issue is multi-faceted; on the one hand it is about de-duplicating paths within a single file (for example, we reference the same file 5-6 times), and de-duplicating path fragments across files.