HTML/CSS support: "site" support?

I have an HTML file that imports a CSS stylesheet:

IDEA marks the /scheduler.css as an error, because it can't find scheduler.css. I think IDEA needs the idea of a "site" so that paths like this can resolve. Is anything like this being planned? If so, it's not listed in the JIRA. I think the OpenAPI should also contain a pluggable URL resolution API. My favorite Apache directive, "Options +MultiViews" allows my URL's to be free of file extensions. So for example, I can use when the actual filename is icon.png. Similarly, I can do ]]> and Apache will return /styles/main.css.

This kind of feature could only be supported with such an OpenAPI feature. So, is something like this planned for Irida? I don't see anything in the JIRA. If not, I'll file an issue myself.

10 comments
Comment actions Permalink

Hi,

Setup the web module (it has the notion of the site) then it will work.

Keith Lea wrote:

I have an HTML file that imports a CSS stylesheet:

<link rel="stylesheet" type="text/css" href="/scheduler.css" />

IDEA marks the /scheduler.css as an error, because it can't find scheduler.css. I think IDEA needs the idea of a "site" so that paths like this can resolve. Is anything like this being planned? If so, it's not listed in the JIRA.

I think the OpenAPI should also contain a pluggable URL resolution API. My favorite Apache directive, "Options +MultiViews" allows my URL's to be free of file extensions. So for example, I can use <img src="icon"> when the actual filename is icon.png. Similarly, I can do <link ... href="/styles/main" /> and Apache will return /styles/main.css.

This kind of feature could only be supported with such an OpenAPI feature. So, is something like this planned for Irida? I don't see anything in the JIRA. If not, I'll file an issue myself.


Yes, this is discussed here]]>



--
Maxim Mossienko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

In article <24867792.1106687066133.JavaMail.itn@is.intellij.net>,
Keith Lea <keith@cs.oswego.edu> wrote:

I have an HTML file that imports a CSS stylesheet:

<link rel="stylesheet" type="text/css" href="/scheduler.css" />

IDEA marks the /scheduler.css as an error, because it can't find
scheduler.css. I think IDEA needs the idea of a "site" so that paths like
this can resolve. Is anything like this being planned? If so, it's not listed
in the JIRA.

I think the OpenAPI should also contain a pluggable URL resolution API. My
favorite Apache directive, "Options +MultiViews" allows my URL's to be free
of file extensions. So for example, I can use <img src="icon"> when the
actual filename is icon.png. Similarly, I can do <link ...
href="/styles/main" /> and Apache will return /styles/main.css.

This kind of feature could only be supported with such an OpenAPI feature.
So, is something like this planned for Irida? I don't see anything in the
JIRA. If not, I'll file an issue myself.


Keith,

If you setup your webapp properly, like make sure that css gets deployed
in the right location etc... idea will find and resolve the .css, you
don't need a site concept or anything. They already have a web app
concept which is more than enough I think.

R

0
Comment actions Permalink

That was my problem, I'm using a Java module.

I'm not making a web application, and I don't want a web.xml. I think there should be a new kind of module, "Site module" or something like that, for non-webapp websites.

0
Comment actions Permalink

In article <15975182.1106689937637.JavaMail.itn@is.intellij.net>,
Keith Lea <keith@cs.oswego.edu> wrote:

That was my problem, I'm using a Java module.

I'm not making a web application, and I don't want a web.xml. I think there
should be a new kind of module, "Site module" or something like that, for
non-webapp websites.


Or modify the web module to not require a web.xml which CAN be possible,
but is not currently allowed in idea. A web site is a web module, is
there a different kind of web site that is not web-based?

I'd rather see a modification to the web module, but can see your point
about the Site module. I think that if you used a web module with no
web.xml, and wanted to later push your site to something more, you can
simply add a web.xml and various other files you need and you don't need
to resetup your module from scratch.

For now I just have an empty web.xml. It doesn't hurt anything.

R

0
Comment actions Permalink

Okay, I set up a web module, and I put the CSS in my "resources" folder, which maps to "/" in the webapp (the default location). IDEA still doesn't recognize the href (but I can edit the files, they're in my project tree). Is there something else I'm missing?

Also, it may be important, these HTML files are in my Java sourcepath (but the CSS files are not).

0
Comment actions Permalink

Hi,

Html should be also in web resource directory.

Keith Lea wrote:

Okay, I set up a web module, and I put the CSS in my "resources" folder, which maps to "/" in the webapp (the default location). IDEA still doesn't recognize the href (but I can edit the files, they're in my project tree). Is there something else I'm missing?

Also, it may be important, these HTML files are in my Java sourcepath (but the CSS files are not).



--
Maxim Mossienko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Unfortunately the web framework I'm using, RIFE, requires that HTML files be in the sourcepath. Should I file a request to IDEA JIRA about this?

0
Comment actions Permalink

In article <30191661.1106862231293.JavaMail.itn@is.intellij.net>,
Keith Lea <keith@cs.oswego.edu> wrote:

Unfortunately the web framework I'm using, RIFE, requires that HTML files be
in the sourcepath. Should I file a request to IDEA JIRA about this?


Yuk, if that truly is the requirement, wth are people thinking anymore?

Please don't cause JB to litter the IDE because of some framework's very
very odd requirement, which I've never encountered in any other one.

R

0
Comment actions Permalink

I believe with RIFE, HTML templates are converted to class files, for performance reasons. It's probably easier to be able to load them from the classpath than from the filesystem. I don't think allowing HTML files to be in the sourcepath would be littering the IDE. It would never affect people who didn't use it, and it would only help people who did. I don't think it would be more than a few lines of code, but I don't know.

0
Comment actions Permalink

Hi,

As workaroubd try use relative path to css.

Keith Lea wrote:

I believe with RIFE, HTML templates are converted to class files, for performance reasons. It's probably easier to be able to load them from the classpath than from the filesystem. I don't think allowing HTML files to be in the sourcepath would be littering the IDE. It would never affect people who didn't use it, and it would only help people who did. I don't think it would be more than a few lines of code, but I don't know.



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.