Forum: www.mikrocontroller.net Vorlage:Scrollbox


von Johann L. (gjlayde) Benutzerseite


Lesenswert?

Hi,

ich hab mit erlaubt (mal wieder) ne neue Vorlage zu basteln.

In vielen Wiki-Artikeln gibt's kilometerweise Code. Das ist zwar ganz 
nett, aber ich find's nicht gerade übersichtlich, hunderte von 
Code-Zeilen in einem Artikel zu haben.

Mit der Scrollbox hat man die Mäglichkeit, ein kleines Scrollfenster 
gewünschter Höhe auf die Seite zu machen, zB um längere 
Quellcode-Schnippel reinzupacken.

Beispiel: AVR-Arithmetik/Sinus und Cosinus

Nett wär dann noch ein kleines JavaScript-Schnippel, mit dem man per 
MausClick genau den ausgezeichneten Schnippel markieren kann, um ihn 
woanders wieder einzufügen. ZB ins eigene Programm.

von Gast (Gast)


Lesenswert?

I cannot print the program in the scroll box.
It seems a BAD idea to me....

I like your contributions (arithmetics!) very much.!!

von Gast (Gast)


Lesenswert?

And why is the program and nor the comment/explanation in a scroll box?
Do you think the explanation is more important?

von Jörg W. (dl8dtl) (Moderator) Benutzerseite


Lesenswert?

Johann L. schrieb:

> Nett wär dann noch ein kleines JavaScript-Schnippel, mit dem man per
> MausClick genau den ausgezeichneten Schnippel markieren kann, um ihn
> woanders wieder einzufügen. ZB ins eigene Programm.

Verstehe ich nicht, copy & paste funktioniert doch ganz normal darin?

von Johann L. (gjlayde) Benutzerseite


Lesenswert?

Gast schrieb:
> I cannot print the program in the scroll box.
> It seems a BAD idea to me....
>
> I like your contributions (arithmetics!) very much.!!

To me, the idea of printing hundreds of lines of code wouln'd even 
occur...  So I was not aware of that problem. However, this could be 
accomplished by CSS classes providing printer friendly layouts.

Gast schrieb:
> And why is the program and nor the comment/explanation in a scroll box?
> Do you think the explanation is more important?

The article explains the code. What it is good for, how it must be 
interfaced, how input and output are represented, what the average 
precision and maximal errors are, what its caveats are, what its WCET 
(worst code execution time) is, etc.

The source is the very reason why the article is there. However, it is 
rather annoying to read an article with miles of code in it.

I must admit that I prefer articles that are typographically appealing 
and care for an appealing layout of its images, tables and code 
snippets.

The article in question is not a part of the assembler tutorial, so this 
should be ok.

Jörg Wunsch schrieb:
> Johann L. schrieb:
>
>> Nett wär dann noch ein kleines JavaScript-Schnippel, mit dem man per
>> MausClick genau den ausgezeichneten Schnippel markieren kann, um ihn
>> woanders wieder einzufügen. ZB ins eigene Programm.
>
> Verstehe ich nicht, copy & paste funktioniert doch ganz normal darin?

Jepp, aber vorm Copy muss man das Zeug erstmal markiert haben, und bei 
mehreren Seiten Code "flutscht" manchmal ein Scrollbar weg oder so. Vor 
allem dann, wenn ein Code-Snip nicht in einer eigenen Box drinne ist und 
sehr lange ist, ist das Markieren manchmal nervig und das Ende des Codes 
nicht immer leicht ersichtlich. Mit einem Click wäre das recht 
komfortabel, ähnlich wie zB in
   http://www.roboternetz.de/phpBB2/viewtopic.php?t=49068
wo man Quell-Boxen auf- und einklappen oder markieren kann.

Johann

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.