[libav-devel] [PATCH] index: report just the latest 10 news items
Limit the space taken to 30 lines anyway. --- Now with a more custom style. Makefile | 7 --- htdocs/css/bootstrap.css | 13 +++-- sed_commands | 13 - split.awk| 20 4 files changed, 31 insertions(+), 22 deletions(-) delete mode 100644 sed_commands create mode 100644 split.awk diff --git a/Makefile b/Makefile index e843bef..bf95afa 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,12 @@ all: $(TARGETS) clean: rm -f $(TARGETS) -htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) +htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) split.awk cat src/template_head1 $<_title \ src/template_head2 \ - src/template_head3 $< src/news \ - src/template_footer > $@ + src/template_head3 $< > $@ + awk -f split.awk src/news >> $@ + cat src/template_footer >> $@ htdocs/%.html: src/% src/%_title $(PAGE_DEPS) cat src/template_head1 $<_title \ diff --git a/htdocs/css/bootstrap.css b/htdocs/css/bootstrap.css index a398f84..ca4ec73 100644 --- a/htdocs/css/bootstrap.css +++ b/htdocs/css/bootstrap.css @@ -1166,16 +1166,17 @@ legend small { .pager a, .pager span { display: inline-block; - padding: 5px 14px; + padding: 4px 10px; background-color: #fff; - border: 1px solid #ddd; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + color: #356635; + border: 1px solid #D0E6BE; } .pager a:hover { text-decoration: none; - background-color: #f5f5f5; + background-color: #DFF0D8; } .pager .next a, .pager .next span { diff --git a/sed_commands b/sed_commands deleted file mode 100644 index d0bd7fa..000 --- a/sed_commands +++ /dev/null @@ -1,13 +0,0 @@ -/LIBAV_ABOUT_NAVBAR/a\ -\ -About/ \ -Projects Using Libav\ - -/LIBAV_ABOUT_NAVBAR/d - -/LIBAV_LEGAL_NAVBAR/a\ -\ -License and Legal Issues\ -Hall of Shame\ - -/LIBAV_LEGAL_NAVBAR/d diff --git a/split.awk b/split.awk new file mode 100644 index 000..e3b4950 --- /dev/null +++ b/split.awk @@ -0,0 +1,20 @@ +BEGIN { +url = ARGV[1] ".html" +sub(/^.*\//, "", url) +} + +/ 5 || NR > 30) { +print "read more"; +exit 0; +} +} +{ print } -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] index: report just the latest 10 news items
On 10/14/2012 07:30 PM, Måns Rullgård wrote: > Luca Barbato writes: > +sub(/\".*/, "", name); +name = url "#" name; +} + +/\/ { >>> >>> That pattern looks wrong. What are you actually trying to match? >> >> "\<" is wrong, to match any h3 " > I was mainly thinking of the [^h3] part. This will prevent matching > anything with an 'h' or a '3' in the title. Somehow I don't think > that's what you meant. Indeed +count++; +if (count > 5 || NR > 30) { +print ">>> "\">more"; >>> >>> Why the ? >> >> evil bootstrap stock pager done according the evil html5 guideline, I >> can make it a centered div, but was feeling lazy on doing custom css. > > When you start working for your tools... Debating would make void the time I spared not having to write custom css and coming up with an irregular syntax for an element standardized in the current spec^draft... lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] index: report just the latest 10 news items
Luca Barbato writes: >>> +sub(/\".*/, "", name); >>> +name = url "#" name; >>> +} >>> + >>> +/\/ { >> >> That pattern looks wrong. What are you actually trying to match? > > "\<" is wrong, to match any h3 ">> +count++; >>> +if (count > 5 || NR > 30) { >>> +print ">> "\">more"; >> >> Why the ? > > evil bootstrap stock pager done according the evil html5 guideline, I > can make it a centered div, but was feeling lazy on doing custom css. When you start working for your tools... -- Måns Rullgård m...@mansr.com ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] index: report just the latest 10 news items
On 10/14/2012 06:25 PM, Måns Rullgård wrote: > Luca Barbato writes: > >> Limit the space taken to 30 lines anyway. >> --- >> >> This should make Diego happy =P >> The pager is a little ugly so I guess I'll change it to something more square >> and green. >> >> Makefile | 7 --- >> awk_split| 20 >> sed_commands | 13 - >> 3 files changed, 24 insertions(+), 16 deletions(-) >> create mode 100644 awk_split >> delete mode 100644 sed_commands >> >> diff --git a/Makefile b/Makefile >> index e843bef..6832efe 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -16,11 +16,12 @@ all: $(TARGETS) >> clean: >> rm -f $(TARGETS) >> >> -htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) >> +htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) awk_split >> cat src/template_head1 $<_title \ >> src/template_head2 \ >> -src/template_head3 $< src/news \ >> -src/template_footer > $@ >> +src/template_head3 $< > $@ >> +awk -f awk_split src/news >> $@ >> +cat src/template_footer >> $@ >> >> htdocs/%.html: src/% src/%_title $(PAGE_DEPS) >> cat src/template_head1 $<_title \ >> diff --git a/awk_split b/awk_split >> new file mode 100644 >> index 000..2b034c3 >> --- /dev/null >> +++ b/awk_split > > Why not split.awk? > no reason, I'll rename. >> @@ -0,0 +1,20 @@ >> +BEGIN { >> +url = ARGV[1] ".html" >> +sub(/^.*\//, "", url) >> +} >> + >> +/> +name = $2; >> +sub(/[^\"]*\"/, "", name ); > > Stray space before ) Righ > >> +sub(/\".*/, "", name); >> +name = url "#" name; >> +} >> + >> +/\/ { > > That pattern looks wrong. What are you actually trying to match? "\<" is wrong, to match any h3 "> +count++; >> +if (count > 5 || NR > 30) { >> +print "> "\">more"; > > Why the ? evil bootstrap stock pager done according the evil html5 guideline, I can make it a centered div, but was feeling lazy on doing custom css. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] index: report just the latest 10 news items
Luca Barbato writes: > Limit the space taken to 30 lines anyway. > --- > > This should make Diego happy =P > The pager is a little ugly so I guess I'll change it to something more square > and green. > > Makefile | 7 --- > awk_split| 20 > sed_commands | 13 - > 3 files changed, 24 insertions(+), 16 deletions(-) > create mode 100644 awk_split > delete mode 100644 sed_commands > > diff --git a/Makefile b/Makefile > index e843bef..6832efe 100644 > --- a/Makefile > +++ b/Makefile > @@ -16,11 +16,12 @@ all: $(TARGETS) > clean: > rm -f $(TARGETS) > > -htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) > +htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) awk_split > cat src/template_head1 $<_title \ > src/template_head2 \ > - src/template_head3 $< src/news \ > - src/template_footer > $@ > + src/template_head3 $< > $@ > + awk -f awk_split src/news >> $@ > + cat src/template_footer >> $@ > > htdocs/%.html: src/% src/%_title $(PAGE_DEPS) > cat src/template_head1 $<_title \ > diff --git a/awk_split b/awk_split > new file mode 100644 > index 000..2b034c3 > --- /dev/null > +++ b/awk_split Why not split.awk? > @@ -0,0 +1,20 @@ > +BEGIN { > +url = ARGV[1] ".html" > +sub(/^.*\//, "", url) > +} > + > +/ +name = $2; > +sub(/[^\"]*\"/, "", name ); Stray space before ) > +sub(/\".*/, "", name); > +name = url "#" name; > +} > + > +/\/ { That pattern looks wrong. What are you actually trying to match? > +count++; > +if (count > 5 || NR > 30) { > +print " "\">more"; Why the ? > +exit 0; > +} > +} > +{ print } -- Måns Rullgård m...@mansr.com ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] index: report just the latest 10 news items
Limit the space taken to 30 lines anyway. --- This should make Diego happy =P The pager is a little ugly so I guess I'll change it to something more square and green. Makefile | 7 --- awk_split| 20 sed_commands | 13 - 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 awk_split delete mode 100644 sed_commands diff --git a/Makefile b/Makefile index e843bef..6832efe 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,12 @@ all: $(TARGETS) clean: rm -f $(TARGETS) -htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) +htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) awk_split cat src/template_head1 $<_title \ src/template_head2 \ - src/template_head3 $< src/news \ - src/template_footer > $@ + src/template_head3 $< > $@ + awk -f awk_split src/news >> $@ + cat src/template_footer >> $@ htdocs/%.html: src/% src/%_title $(PAGE_DEPS) cat src/template_head1 $<_title \ diff --git a/awk_split b/awk_split new file mode 100644 index 000..2b034c3 --- /dev/null +++ b/awk_split @@ -0,0 +1,20 @@ +BEGIN { +url = ARGV[1] ".html" +sub(/^.*\//, "", url) +} + +// { +count++; +if (count > 5 || NR > 30) { +print "more"; +exit 0; +} +} +{ print } diff --git a/sed_commands b/sed_commands deleted file mode 100644 index d0bd7fa..000 --- a/sed_commands +++ /dev/null @@ -1,13 +0,0 @@ -/LIBAV_ABOUT_NAVBAR/a\ -\ -About/ \ -Projects Using Libav\ - -/LIBAV_ABOUT_NAVBAR/d - -/LIBAV_LEGAL_NAVBAR/a\ -\ -License and Legal Issues\ -Hall of Shame\ - -/LIBAV_LEGAL_NAVBAR/d -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel