You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Mike A." <mi...@gmail.com> on 2007/08/30 03:00:13 UTC
[svn] viewing of html files via browser
Hi Guys,
Just want to know if there's a way I can view through browser the html file
in the repository as html page not as code.
Regards,
Mike
Re: [svn] viewing of html files via browser
Posted by Peter Connolly <ps...@gmail.com>.
...using viewvc?
On 8/29/07, Mike A. <mi...@gmail.com> wrote:
>
> Hi Guys,
>
> Just want to know if there's a way I can view through browser the html
> file in the repository as html page not as code.
>
> Regards,
>
> Mike
>
Re: [svn] viewing of html files via browser
Posted by Andy Levy <an...@gmail.com>.
On 8/31/07, Mark Reibert <sv...@reibert.com> wrote:
> On Thu, 2007-08-30 at 08:15 -0400, Andy Levy wrote:
> > On 8/30/07, Mike A. <mi...@gmail.com> wrote:
> > > Thanks for this Mark. Maybe thats what I should do, just inform the user
> > > about the autoprops config. Anyway, just another question, I tried it out in
> > > one of our html file and noticed that css file are not interpreted (results
> > > to html file not displaying properly), is this really the case?
> >
> > Same root cause. Set the svn:mime-type on the CSS files to text/css
> > and it should work. Lather, rinse, repeat for text/javascript (JS
> > files), your images (image/gif, image/png, image/jpeg) and so on.
>
> So, you are saying that as long as the CSS files have the correct mime
> type, mod_dav_svn will will render the HTML file with the referenced
> CSS? I did not expect that (but I have not tried it either).
mod_dav_svn isn't rendering anything. Your browser is. Mod_dav_svn is
only supplying the file contents to your browser.
Many browsers (correctly) will only use files from a web server the
way you're thinking if they're served with the correct mime-type. If
you set svn:mime-type, that value will be supplied in the HTTP headers
when the browser requests the file.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by Andy Levy <an...@gmail.com>.
On 8/31/07, Mark Reibert <sv...@reibert.com> wrote:
> On Fri, 2007-08-31 at 07:55 +0200, Rainer Sokoll wrote:
> > > So, you are saying that as long as the CSS files have the correct mime
> > > type, mod_dav_svn will will render the HTML file with the referenced
> > > CSS? I did not expect that (but I have not tried it either).
> >
> > I would expect that.
> > The Browser issues "GET foo.html". foo.html contains a link to bar.css,
> > therefore the browser has to make an additional "GET bar.css" - and
> > subversion will happily deliver bar.css. As long as both files are
> > delivered with the correct MIME type, the browser will render them.
>
> Hmm, I guess since the HTML <link rel="stylesheet" ... /> tags typically
> contain a type="text/css" attribute, I thought having svn:mime-type on
> the CSS would not matter. But now I am curious!
Some browsers are very particular about it.
Costs nothing to try, right?
Like (I think) I said earlier in the thread, it's so easy to supply a
mime-type and so "cheap", it just makes good sense (IMO) to provide as
much metadata for each file as you can. It'll ensure proper handling,
instead of guessing, on the part of all software that's mime-type
aware. It leaves no ambiguity about the mergeability of the file when
Subversion is working on it, and helps when browsing the repository
via basic HTTP.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by Mark Reibert <sv...@reibert.com>.
On Fri, 2007-08-31 at 07:55 +0200, Rainer Sokoll wrote:
> > So, you are saying that as long as the CSS files have the correct mime
> > type, mod_dav_svn will will render the HTML file with the referenced
> > CSS? I did not expect that (but I have not tried it either).
>
> I would expect that.
> The Browser issues "GET foo.html". foo.html contains a link to bar.css,
> therefore the browser has to make an additional "GET bar.css" - and
> subversion will happily deliver bar.css. As long as both files are
> delivered with the correct MIME type, the browser will render them.
Hmm, I guess since the HTML <link rel="stylesheet" ... /> tags typically
contain a type="text/css" attribute, I thought having svn:mime-type on
the CSS would not matter. But now I am curious!
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by Rainer Sokoll <R....@intershop.de>.
On Thu, Aug 30, 2007 at 09:42:33PM -0700, Mark Reibert wrote:
> On Thu, 2007-08-30 at 08:15 -0400, Andy Levy wrote:
> > Same root cause. Set the svn:mime-type on the CSS files to text/css
> > and it should work. Lather, rinse, repeat for text/javascript (JS
> > files), your images (image/gif, image/png, image/jpeg) and so on.
>
> So, you are saying that as long as the CSS files have the correct mime
> type, mod_dav_svn will will render the HTML file with the referenced
> CSS? I did not expect that (but I have not tried it either).
I would expect that.
The Browser issues "GET foo.html". foo.html contains a link to bar.css,
therefore the browser has to make an additional "GET bar.css" - and
subversion will happily deliver bar.css. As long as both files are
delivered with the correct MIME type, the browser will render them.
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by Mark Reibert <sv...@reibert.com>.
On Thu, 2007-08-30 at 08:15 -0400, Andy Levy wrote:
> On 8/30/07, Mike A. <mi...@gmail.com> wrote:
> > Thanks for this Mark. Maybe thats what I should do, just inform the user
> > about the autoprops config. Anyway, just another question, I tried it out in
> > one of our html file and noticed that css file are not interpreted (results
> > to html file not displaying properly), is this really the case?
>
> Same root cause. Set the svn:mime-type on the CSS files to text/css
> and it should work. Lather, rinse, repeat for text/javascript (JS
> files), your images (image/gif, image/png, image/jpeg) and so on.
So, you are saying that as long as the CSS files have the correct mime
type, mod_dav_svn will will render the HTML file with the referenced
CSS? I did not expect that (but I have not tried it either).
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by Andy Levy <an...@gmail.com>.
On 8/30/07, Mike A. <mi...@gmail.com> wrote:
> Thanks for this Mark. Maybe thats what I should do, just inform the user
> about the autoprops config. Anyway, just another question, I tried it out in
> one of our html file and noticed that css file are not interpreted (results
> to html file not displaying properly), is this really the case?
Same root cause. Set the svn:mime-type on the CSS files to text/css
and it should work. Lather, rinse, repeat for text/javascript (JS
files), your images (image/gif, image/png, image/jpeg) and so on.
IMHO, the more metadata I can put into my repository regarding "what"
a file is, the better - so I try to apply a mime-type on every file
possible. It just so happens that this has a few side benefits when
viewing the "bare" repository via a web browser.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by Mark Reibert <sv...@reibert.com>.
On Thu, 2007-08-30 at 12:53 +0800, Mike A. wrote:
> Thanks for this Mark. Maybe thats what I should do, just inform the
> user about the autoprops config. Anyway, just another question, I
> tried it out in one of our html file and noticed that css file are not
> interpreted (results to html file not displaying properly), is this
> really the case?
Sounds about right to me. mod_dav_svn provides the capability to browse
the repository, but keep in mind you are peering into a versioning
repository and not serving up web pages in the classic sense. So I would
not expect mod_dav_svn to respond to a CSS request in the same way your
traditional web server would.
Think of it this way: You are really just fetching individual files from
the repository via the web. It just so happens mod_dav_svn will set the
HTTP header Content-Type field if the svn:mime-type property exists on
the file. It is just doing you a favor!
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by "Mike A." <mi...@gmail.com>.
Thanks for this Mark. Maybe thats what I should do, just inform the user
about the autoprops config. Anyway, just another question, I tried it out in
one of our html file and noticed that css file are not interpreted (results
to html file not displaying properly), is this really the case?
Thanks!
On 8/30/07, Mark Reibert <sv...@reibert.com> wrote:
>
> On Thu, 2007-08-30 at 11:57 +0800, Mike A. wrote:
> > Thanks Mark, but is there any other way I can set it in each
> > repository in the server so that I don't need to ask every user.
>
> Unfortunately, not at this time. Repository-defined autoprops are listed
> as a medium-term goal on the Subversion roadmap
> (http://subversion.tigris.org/roadmap.html), but they do not yet exist.
>
> If your user base is small enough you could distribute a common SVN
> client configuration file that contains the autoprops you want. I have
> done this for past small groups, going so far as to wrap it up in an
> installer for the Windows clients. If your user base is large then I am
> afraid there is no good answer.
>
> > Maybe we can do it in hooks but I'm not that familiar with setting up
> > hooks yet :)
>
> This would not be advisable as there are subtle but important reasons to
> not modify a transaction in a pre-commit hook. Check out the link below
> and scroll down to the pink warning box.
>
>
> http://svnbook.red-bean.com/en/1.4/svn.reposadmin.create.html#svn.reposadmin.create.hooks
>
> --
> ----------------------
> Mark S. Reibert, Ph.D.
> svn@reibert.com
> ----------------------
>
>
Re: [svn] viewing of html files via browser
Posted by Andy Levy <an...@gmail.com>.
On 8/30/07, Mark Reibert <sv...@reibert.com> wrote:
> > Maybe we can do it in hooks but I'm not that familiar with setting up
> > hooks yet :)
>
> This would not be advisable as there are subtle but important reasons to
> not modify a transaction in a pre-commit hook. Check out the link below
> and scroll down to the pink warning box.
>
> http://svnbook.red-bean.com/en/1.4/svn.reposadmin.create.html#svn.reposadmin.create.hooks
True, but that doesn't mean you can't have the hook inspect the files
being committed, and reject the commit if the mime-types haven't been
applied (with an appropriate message back to the user).
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by Mark Reibert <sv...@reibert.com>.
On Thu, 2007-08-30 at 11:57 +0800, Mike A. wrote:
> Thanks Mark, but is there any other way I can set it in each
> repository in the server so that I don't need to ask every user.
Unfortunately, not at this time. Repository-defined autoprops are listed
as a medium-term goal on the Subversion roadmap
(http://subversion.tigris.org/roadmap.html), but they do not yet exist.
If your user base is small enough you could distribute a common SVN
client configuration file that contains the autoprops you want. I have
done this for past small groups, going so far as to wrap it up in an
installer for the Windows clients. If your user base is large then I am
afraid there is no good answer.
> Maybe we can do it in hooks but I'm not that familiar with setting up
> hooks yet :)
This would not be advisable as there are subtle but important reasons to
not modify a transaction in a pre-commit hook. Check out the link below
and scroll down to the pink warning box.
http://svnbook.red-bean.com/en/1.4/svn.reposadmin.create.html#svn.reposadmin.create.hooks
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: [svn] viewing of html files via browser
Posted by "Mike A." <mi...@gmail.com>.
Thanks Mark, but is there any other way I can set it in each repository in
the server so that I don't need to ask every user.
Maybe we can do it in hooks but I'm not that familiar with setting up hooks
yet :)
Thanks!
On 8/30/07, Mark Reibert <sv...@reibert.com> wrote:
>
> On Thu, 2007-08-30 at 11:00 +0800, Mike A. wrote:
> > Just want to know if there's a way I can view through browser the html
> > file in the repository as html page not as code.
>
> If the files have the svn:mime-type property properly set to 'text/html'
> your browser will render them as HTML.
>
> You may wish to encourage the clients of your repository to use the
> "autoprops" feature:
>
>
> http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html#svn.advanced.props.auto
>
> Unfortunately, as of now this is a client-side feature, so unless all
> the clients agree to do this there will be gaps in the property
> settings.
>
> --
> ----------------------
> Mark S. Reibert, Ph.D.
> svn@reibert.com
> ----------------------
>
>
Re: [svn] viewing of html files via browser
Posted by Mark Reibert <sv...@reibert.com>.
On Thu, 2007-08-30 at 11:00 +0800, Mike A. wrote:
> Just want to know if there's a way I can view through browser the html
> file in the repository as html page not as code.
If the files have the svn:mime-type property properly set to 'text/html'
your browser will render them as HTML.
You may wish to encourage the clients of your repository to use the
"autoprops" feature:
http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html#svn.advanced.props.auto
Unfortunately, as of now this is a client-side feature, so unless all
the clients agree to do this there will be gaps in the property
settings.
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org