mirror of
https://github.com/vale981/ablog
synced 2025-03-05 09:11:38 -05:00
Merge pull request #6 from nabobalis/master
Code changes from PR and Issue Comments
This commit is contained in:
commit
82ed8b7a77
2 changed files with 8 additions and 4 deletions
|
@ -92,6 +92,7 @@ CONFIG = [
|
|||
|
||||
|
||||
TOMORROW = datetime.today() + dtmod.timedelta(1)
|
||||
TOMORROW = TOMORROW.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
FUTURE = datetime(9999, 12, 31)
|
||||
|
||||
|
||||
|
|
|
@ -95,14 +95,17 @@ class PostDirective(Directive):
|
|||
|
||||
|
||||
class UpdateDirective(BaseAdmonition):
|
||||
|
||||
required_arguments = 1
|
||||
node_class = UpdateNode
|
||||
|
||||
def run(self):
|
||||
|
||||
ad = super(UpdateDirective, self).run()
|
||||
ad[0]['date'] = self.arguments[0] if self.arguments else ''
|
||||
date_arg = self.arguments[0] if self.arguments else ''
|
||||
self.arguments = [_('Updated on ' + date_arg), ]
|
||||
# The following line is needed to trick the BaseAdmonition class into thinking we have a title.
|
||||
# There almost certainly has to be a better way, but I don't see it naturally from the docutils source
|
||||
self.node_class = nodes.admonition
|
||||
ad = super(UpdateDirective, self).run() # For Python3, it is run(), not run(self)
|
||||
del self.node_class # Undo our tricksy hack from a few lines ago
|
||||
return ad
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue