[AIRFLOW-3996] Add view source link to included fragments#4894
[AIRFLOW-3996] Add view source link to included fragments#4894Fokko merged 1 commit intoapache:masterfrom
Conversation
4d8357d to
139bdff
Compare
|
I like where it heads :). I like that it works now with mobile/smaller screen. Ie think it will be much more readable for all examples to get the links to example files! I am quite ok with linking to the file rather than to particular part of example (it would have been much more complex to link to particular source code). But maybe we should make file names also links to the source code (similarly as in Google GCP examples. For example here: https://cloud.google.com/functions/docs/tutorials/pubsub |
There was a problem hiding this comment.
Can we do this via subclassing LiteralInclude so we don't have to have so much code here?
There was a problem hiding this comment.
I know that we have a lot of code, but it is not possible to extend this class. The logic of this directive is contained in one method. There is no method that we can extend to add new expected behavior.
There was a problem hiding this comment.
If we subclass we at least don't have to set the option_spec and other class properties.
There was a problem hiding this comment.
Which version did you copy from? There are odd/subtle differences from the version linked to
There was a problem hiding this comment.
Unless I'm missing something (I've only had a quick look) I think we should be able to do this as something like:
def run(self):
_, filename = self.env.relfn2path(self.arguments[0])
retnode, = super().run()
container_node = nodes.container("", literal_block=True, classes=["example-block-wrapper"])
container_node += example_header(filename=filename)
container_node += retnode
retnode = container_node
return [retnode]?
There was a problem hiding this comment.
(I figured there was some auto-formatting going on)
A link to that would more helpful than master :)
The only change in option_spec is the removal of caption right? Basically there is a lot of code here that we haven't really changed, and it's hard to work out what is special and what isn't.
There was a problem hiding this comment.
I will prepare a detailed description of the changes that I made in the code of this class tomorrow.
There was a problem hiding this comment.
Can you wait with review? I did not think that this change might require such a discussion
There was a problem hiding this comment.
I might be over thinking it - still, a comment in the source would help future Us.
There was a problem hiding this comment.
Diff changes: https://pastebin.com/W4eHex7C
Line 1-5: I changed the name of the class. No comemnts
Line 6-15: I updated description of class. No comments
Line 16-17: I remove caption. Now, we use a filename as a caption allways.
Line 18-19 At the time of writing PR, there were no validation types in the project.
Line 20-25: There are two changes here.
a) I dropped support for translating the message. We do not support translations in the project.
b) I pass a arguments to logger. Reason available: #4804
Line 26-38.
a) I dropped caption support. It was conflicting with the new header.
b) I added a new header. This uses the file name as the header content.
Unless I'm missing something (I've only had a quick look) I think we should be able to do this as something like:
I did not find the official API to make a distinction. This is just one class and I decided it would be better to copy it. I've done research on how other people implement extensions for this directive and other people also copy the full class code
https://github.com/FabriceSalvaire/sphinx-getthecode/blob/master/sphinxcontrib/getthecode.py#L27-L32
139bdff to
3165ca0
Compare
|
I updated a PR to apply suggestion. i also deleted |
|
@mik-laj Can you rebase? |
3165ca0 to
f32828b
Compare
f32828b to
d8efdc3
Compare
…lta SLAs (apache#4939) Modify SchedulerJob.manage_slas to respect zero timedelta SLAs
|
Conflicts, again 🤔 |
cfefecd to
e62d247
Compare
|
@Fokko, I updated a PR |
e62d247 to
72ed975
Compare
Codecov Report
@@ Coverage Diff @@
## master #4894 +/- ##
=======================================
Coverage 75.81% 75.81%
=======================================
Files 458 458
Lines 29882 29882
=======================================
Hits 22655 22655
Misses 7227 7227Continue to review full report at Codecov.
|
|
@Fokko It's green. |

Make sure you have checked all steps below.
Jira
Description
I added buttons that will allow you to go to the source code of the whole file with an example.
Preview: http://bloody-boundary.surge.sh/howto/operator/bash.html
UI component has been adapted to mobile devices.
We've discussed the different look of the header internally. It did not include a button but a clickable filename. A vote took place and this is a winning proposition.
Currently, it does not work for some GCP operator examples due to errors in their implementation. My team is planning to improve these operators in the future. I also plan that other examples should also contain the full source code and be tested on Travis - PolideaInternal#77
CC: @potiuk
Tests
Commits
Documentation
Code Quality
flake8