Tech Off Thread

11 posts

Storing text for online article database...

Back to Forum: Tech Off
  • User profile image
    jsampsonPC

    Hey Niners,

    I'm working on an article database right now, and have introduced a bit of frustration into my day when I decided to offer the web-article as on-the-fly PDF's too.

    The article were all stored in the database as HTML. It's ugly, trust me. So I'm deciding what I want to do with them. The HTML is all wrong also, so I do have to go through and do some clean up regardless.

    But I recall being told in the past that articles should never contain ANY markup or css, but if that is the case, how would you write 238Pa without using the SUP tag?

    Just curious how you guys would design an article database beyond simply making a field for the title, author and text Smiley

  • User profile image
    wisemx

    How about a bit of code to strip out the markup?
    Something like this:

    Public Function FormatStr(ByVal MessageString As String) As String
            MessageString = Replace(MessageString, Chr(13), "")
            MessageString = Replace(MessageString, Chr(10) & Chr(10), "</p><p>")
            MessageString = Replace(MessageString, Chr(10), "<br />")
            FormatStr = MessageString
        End Function

    FormatStr(Container.DataItem("message"))

  • User profile image
    W3bbo

    jsampsonPC wrote:
    Hey Niners,

    I'm working on an article database right now, and have introduced a bit of frustration into my day when I decided to offer the web-article as on-the-fly PDF's too.

    The article were all stored in the database as HTML. It's ugly, trust me. So I'm deciding what I want to do with them. The HTML is all wrong also, so I do have to go through and do some clean up regardless.

    But I recall being told in the past that articles should never contain ANY markup or css, but if that is the case, how would you write 238Pa without using the SUP tag?

    Just curious how you guys would design an article database beyond simply making a field for the title, author and text Smiley


    Markdown.

  • User profile image
    jsampsonPC

    Strip out markup? I don't want to do that. I'm asking this: if it's wrong to have markup in your data-field, then how do you apply formatting for articles that need it.

    ...or maybe it's not wrong at all to do basic HTML in the data-field, such as P, STRONG, U, EM, BLOCKQUOTE, etc... any input guys?

  • User profile image
    jsampsonPC

    W3bbo wrote:


    Oh looky-there...this is neat.

    Thanks W3bbo.

  • User profile image
    jh71283

     What about compressing the html that you're storing?

    would that do the trick?

  • User profile image
    ZippyV

    jh71283 wrote:
     What about compressing the html that you're storing?

    would that do the trick?


    How would that solve his problem?

  • User profile image
    jsampsonPC

    ZippyV wrote:
    
    jh71283 wrote:
     What about compressing the html that you're storing?

    would that do the trick?


    How would that solve his problem?


    I'm not looking for compression so much as covenience. I want to get away from mixed-data, and stick with some a bit more pleasing to the eyes and expandable.

    Markdown is extremely great, and seems to solve all of my problems while keeping the text completely readable.

    Markdown + Clean CSS, that is.

  • User profile image
    TheFormer​BrianLy

    jsampsonPC wrote:
    But I recall being told in the past that articles should never contain ANY markup or css, but if that is the case, how would you write 238Pa without using the SUP tag?

    Just curious how you guys would design an article database beyond simply making a field for the title, author and text Smiley


    As W3bbo said, Markdown may do the job for you. Another approach that people take is to invent their own abstract markup with XML and associate XSLTs for web view, print view, edit etc. This can get quite involved. The approach may be better if you have long term requirements with reuse and find that this approach is easier.

    -Brian

  • User profile image
    figuerres

    jsampsonPC wrote:
    
    ZippyV wrote:
    
    jh71283 wrote:
     What about compressing the html that you're storing?

    would that do the trick?


    How would that solve his problem?


    I'm not looking for compression so much as covenience. I want to get away from mixed-data, and stick with some a bit more pleasing to the eyes and expandable.

    Markdown is extremely great, and seems to solve all of my problems while keeping the text completely readable.

    Markdown + Clean CSS, that is.


    just read a bit about it and it sounds GREAT!

  • User profile image
    jsampsonPC

    figuerres wrote:
    Just read a bit about it and it sounds GREAT!


    It is, completely. I used the PHP version, and it's nothing morethan calling the Markdown($source) function. It's so easy to use too. I am actually hiring my wife (who knows next to nothing about HTML/CSS) to come in and reformat the article database for me while I continue coding.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.