Can Amaya manage external style-sheet?

View: New views
9 Messages — Rating Filter:   Alert me  

Can Amaya manage external style-sheet?

by IvanGabor () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have en external style-sheet linked to my document. When I formate the page, I expect that the rules would come up in the external page. But they are coming up inside the html-side. Is it possible to get the css-codes to the external css-sheet?

Can Amaya manage external css?

by IvanGabor () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please, answer me if it is possible to manage external css in Amaya. I enabled an external stylesheet, but anyway, I got only inline css.
EDITED  I get embedded css with Create rule. But how can I get external css? Only copy and past?

Re: Can Amaya manage external css?

by Frédéric WANG :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I have en external style-sheet linked to my document. When I formate the
> page, I expect that the rules would come up in the external page. But they
> are coming up inside the html-side. Is it possible to get the css-codes to
> the external css-sheet?

> Please, answer me if it is possible to manage external css in Amaya. I
> enabled an external stylesheet, but anyway, I got only inline css. Not even
> embedded css. I think that inline css is so totally meaningsless. %-| I want
> to get at least embedded css, but external is best. I try and try untill I
> know that it is impossible.

If I understand well, what you want is the following behaviour: when you select
an element and apply a rule with the WYSIWYG interface, then the rule is
directly written in an external stylesheet. Currently, I don't think the WYSIWYG
interface of Amaya can do this. I suppose this could be implemented by assigning
an id to the element if it does not have one and write its CSS rule in an
external file using this id (with of course the issue of duplicated ids).
However I believe an external stylesheet is used when you want to share a set of
rules between several elements (possibly in different documents). In this case,
I don't really see how it can be implemented easily and with a user-friendly
interface, but it is an interesting open question.

There are three tool panels that can be used to handle style in a semi-WYSIWYG
interface (I don't remember the exact names of the panels):
- the stylesheet panel, where are listed the css files used by your document.
You can add/remove these file or open them. To edit one of the file, you need to
know the CSS syntax but the style dialog (button "CSS" in the toolbar) can help
you: the rules are directly inserted in your CSS file when you close the dialog
box.
- the attribute panel, that can be used to add "ids" to your element.
- the class panel, where are listed the class applied to the selected element.
It can be used to apply/remove classes.


Re: Can Amaya manage external css?

by IvanGabor () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Frédéric WANG wrote:
However I believe an external stylesheet is used when you want to share a set of
rules between several elements (possibly in different documents). In this case,
I don't really see how it can be implemented easily and with a user-friendly
interface, but it is an interesting open question.
Meanwhile I found the "Create rule". It makes me happy when I see inline css jumping up into the <head> embedded as soon I save. It  is very easy to move the embedded css to external css.
The function Create rule is very user-friendly and it would be a good base for choosing linked css too. It would be very fine if Create rule could make it possible to choose linked css instead of embedded. A button could change the target. I suppose, it is a flick to create this function and this would make Amaya really the ultimate wysiwyg.  

Re: Can Amaya manage external css?

by Frédéric WANG :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

IvanGabor wrote:

> Frédéric WANG wrote:
>  
>> However I believe an external stylesheet is used when you want to share a
>> set of
>> rules between several elements (possibly in different documents). In this
>> case,
>> I don't really see how it can be implemented easily and with a
>> user-friendly
>> interface, but it is an interesting open question.
>>
>>    
> "Create rules" is very user-friendly and a good base for this function too.
> I can imagine, when I click Create rule, it would be possible to choose
> linked css instead of embedded. I suppose, it is a flick to create this
> function and this would make Amaya really the ultimate wysiwyg.  
>
>  
I did not remember this feature :-) Allowing insertion in linked css
would certainly be nice. However I don't know exactly how the CSS
stylesheet is parsed by Amaya and whether the source code contains
functions to modify each part easily (as it is the case for XML trees).
So maybe this feature is not so easy to implement for developers...



Re: Can Amaya manage external css?

by Vatton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le vendredi 28 août 2009 à 14:29 -0700, IvanGabor a écrit :
> Please, answer me if it is possible to manage external css in Amaya. I
> enabled an external stylesheet, but anyway, I got only inline css. Not even
> embedded css. I think that inline css is so totally meaningsless. %-| I want
> to get at least embedded css, but external is best. I try and try untill I
> know that it is impossible.

It's possible to link an external CSS stylesheet to a mml document with
a PI.
You can do that with Amaya: Call the command Format > Stylesheets > Link

  o If the stylesheet is open within a tab you can select "Click",
    switch to the tab and click.
  o If the stylesheet is not open within a tab you have to enter the URI

When you confirm Amaya will generate the PI.

--
Irene Vatton <Irene.Vatton@...>
INRIA



Re: How to send rules to the external style-sheet?

by Vatton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le mercredi 26 août 2009 à 16:14 -0700, IvanGabor a écrit :
> I have en external style-sheet linked to my document. When I formate the
> page, I expect that the rules would come up in the external page. But they
> are coming up inside the html-side. Is it possible to get the css-codes to
> the external css-sheet?

Normally yes. Could you give me an example that doesn't work?
--
Irene Vatton <Irene.Vatton@...>
INRIA



Re: Can Amaya manage external css?

by Vatton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le samedi 29 août 2009 à 14:42 -0700, IvanGabor a écrit :

>
> Frédéric WANG wrote:
> >
> > However I believe an external stylesheet is used when you want to share a
> > set of
> > rules between several elements (possibly in different documents). In this
> > case,
> > I don't really see how it can be implemented easily and with a
> > user-friendly
> > interface, but it is an interesting open question.
> >
> "Create rules" is very user-friendly and a good base for this function too.
> I can imagine, when I click Create rule, it would be possible to choose
> linked css instead of embedded. I suppose, it is a flick to create this
> function and this would make Amaya really the ultimate wysiwyg.  

Yes. By default the "Create rule" command generates a CSS rule into a
style element. That command is not proposed for .mml documents as there
is no available style element.

Of course the "Create rule" command could generates the style into an
external stylesheet provided it is already linked to the document.
In that case, the command could apply to .mml documents.

What user interface do you suggest? How to select the right stylesheet
or a style element when several stylesheets are linked?

--
Irene Vatton <Irene.Vatton@...>
INRIA



Re: Can Amaya manage external css?

by Dominique Meeùs-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

IvanGabor a écrit ce qui suit, le 29/08/09 23:42 :
> [...] I can imagine, when I click Create rule, it would be possible to choose
> linked css instead of embedded. I suppose, it is a flick to create this
> function and this would make Amaya really the ultimate wysiwyg.

The function already exists to a certain extent. One may always open (at
the bottom of the Format menu) external CSS files as plain text files.

Amaya controls the quality of the CSS. Write a page with external CSS.
Put an obvious error in it (I did with vertical-align:center instead of
middle). Use the erroneous class in the html page. Then ask in the
Display menu to display errors. This error should be mentioned. If you
double-click the localisation of the error, Amaya opens the external CSS
(as text) and you may edit and save it.

The work that remains to be done is to link this with the CSS rules
creator. One should compare with the CaScadeS editor that KompoZer has
build into NVU and maybe reuse some code, or at least some logic of it.
(This is above my competence: thus "work that remains to be done"… by
others :-) Thanks to the Amaya team for the work already done.)