Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5b414a78

Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt

  • ID 5b414a783834893ccb248ad78dd81f47c3bb03ec
  • Vorgänger 9dd81527
  • Nachfolger fdf75973

MultiMarkdown: hervorgehobene Blöcke durch Einbettung in … implementiert

Unterschiede anzeigen:

css/kivitendo/help.css
23 23
	color: black;
24 24
	vertical-align: top;
25 25
}
26

  
27
.kivitendo-help div.attention {
28
  background-color: #ebebeb;
29
  border: 1px solid #cacaca;
30
  margin: 5px 20px;
31
  padding: 0px 5px;
32
}
33

  
34
.kivitendo-help div.attention p {
35
  margin: 5px 0px;
36
}
37

  
38
.kivitendo-help div.attention p:nth-child(1) {
39
  background-color: #ffff99;
40
  padding: 2px;
41
}
doc/help_system.md
114 114

  
115 115
Auf Github existiert dafür auch ein [pull request](https://github.com/bobtfish/text-multimarkdown/pull/17).
116 116

  
117
### Hervorhebungsblöcke
118

  
119
Ein Block soll hervorgehoben darsgestellt werden (wie z.B. solche »Achtung!«- oder »Information«-Blöcke in Textbüchern zu Programmiersprachen), wenn sie vorhe und hinten mit zwei Gleichheitszeichen eingeschlossen werden. Das unterstützt `Text::MultiMarkdown` momentan gar nicht.
120

  
121 117
### Einfachere Hilfe-Links
122 118

  
123 119
Links auf andere Hilfe-Texte müssen momentan mühsam als `controller.pl?action=Help/show&context=WANTED_CONTROLLER/WANTED_ACTION` angegeben werden. Schöner wäre es, wenn man einfach als Linkziel `help:WANTED_CONTROLLER/WANTED_ACTION` angeben könnte.
modules/override/Text/MultiMarkdown.pm
320 320
    return $text;
321 321
}
322 322

  
323
sub _DoAttentionBlocks {
324
    my ($self, $text) = @_;
325

  
326
    $text =~ s{
327
        (?:\n\n+|\A)
328
        ==
329
        ( .*? )
330
        ==
331
        (?:\n+|\Z)
332
    }{
333
        my $result = qq|\n\n<div class="attention">|;
334
        $result   .= $self->_RunBlockGamut($1, { wrap_in_p_tags => 1 });
335
        $result   .= qq|</div>\n\n|;
336

  
337
        $result;
338
    }egmsx;
339

  
340
    return $text;
341
}
342

  
323 343
sub _Markdown {
324 344
#
325 345
# Main function. The order in which other subs are called here is
......
343 363
    # MMD only
344 364
    $text = $self->_StripMarkdownReferences($text);
345 365
    $text = $self->_DoCodeBlocksMultiBackticks($text);
366
    $text = $self->_DoAttentionBlocks($text);
346 367

  
347 368
    $text = $self->_RunBlockGamut($text, {wrap_in_p_tags => 1});
348 369

  
templates/webpages/help/content/de/_tests/features_1.mmd
28 28

  
29 29
Jezt folgt ein Block, der besonders hervorgehoben werden soll:
30 30

  
31
==Achtung!
32
Dies ist die öffentliche Bekanntmachung, dass kivitendo toll ist!==
31
==**Achtung!**
32

  
33
Dies ist die öffentliche Bekanntmachung, dass kivitendo toll ist! Warum?
34

  
35
* Darum
36
* Weil ist so
37
* Was für eine Frage!?
38

  
39
Echt mal.==
33 40

  
34 41
Jut. Nun dann. Was brauchen wir noch? Richtig, eine Tabelle!
35 42

  

Auch abrufbar als: Unified diff