Comments (7)
Can we ask Git if we are inside a current tag? It would be nice if we could get this automatically but we'd need command line options too. :)
from ex_doc.
What do you mean? Tag just points to a commit. Do you want to automatically find out whether the current commit is tagged? Not sure if that'll help.
The use case for most projects would be to specify the url pattern that includes a specific tag/branch. BTW, we could make it easier for users like we do currently with :github
in url patterns (it only supports master
now IIRC).
For Elixir, do you manually generate the docs by checking out a specific commit? Then you could do:
λ git checkout v0.8.2
# ...
λ git describe --all `git rev-parse HEAD`
tags/v0.8.2
λ git describe --tags `git rev-parse HEAD`
v0.8.2
λ git checkout master
# ...
λ git describe --tags `git rev-parse HEAD`
v0.8.2-95-ga0787fb
λ git describe --all `git rev-parse HEAD`
heads/master
from ex_doc.
λ git describe --tags `git rev-parse HEAD`
tags/v0.8.2
This is exactly what I had in mind. Get the current commit and check: is it in a tag? If so, use the tag, if not, use the commit hash itself. What do you think?
from ex_doc.
To be clear, git describe --all <hash>
could output multiple lines, if the commit hash is pointed to by multiple refs.
Get the current commit and check: is it in a tag?
Hm, I don't think it's our decision to make. Technically, only commit hash will provide 100% reliability in the presence of changes. But the commit itself may become orphan after a force push.
I think the user has to decide. We can provide a shortcut for generating source links based on the current/commit tag in the config options (similar to current :github
). But there has to be a config option for this the that user sets explicitly.
from ex_doc.
@alco is this fixed after you added the ability to specify a commit/branch/tag or not yet?
from ex_doc.
Both master and stable point to v0.9.2. I thought master should point to a specific commit which was master at the time of doc generation.
from ex_doc.
This is because I haven't generating anything from master after v0.9.2. :) I just generated it now and everything worked like a charm, thanks @alco!
from ex_doc.
Related Issues (20)
- ex_doc > 0.30.5 generating incorrect HTML output for ex_money HOT 2
- Build precompiled ExDoc scripts on every release using GitHub Actions
- Introduce search across all of HexDocs HOT 33
- Admonition block content in cheat sheets has incorrect background colour HOT 4
- Refactor autolinking typespecs
- Add a redirect or non-indexed extras page HOT 4
- [PROPOSAL] generate docs for structs HOT 1
- Search for terms beginning with colon (e.g. ":if") HOT 5
- Support converting GitHub alerts to admonitions? HOT 1
- searching on `inner_content` doesn't give any useful results
- no results at all for `phx-update`
- Add "Edit Documentation" link HOT 3
- Adding formal support for filenames HOT 6
- Markdown not supported within <details> element. HOT 4
- Using keybind to focus search flickers the sidebar HOT 1
- Auto link with anchor is not working HOT 6
- Mobile regression: menu icon no longer sticky HOT 6
- URL in browser not updating when clicking link icon on iOS HOT 3
- @since tag not rendered correctly for Erlang source Types? HOT 1
- Add a title attribute to sidebar links HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ex_doc.