Skip to content

Posts tagged ‘WordPress’

5
Jun

ByWord Publishing Test

Update

You might not see if but it did what I expected and converted Markdown to HTML when it published it to my WordPress site – bummer. Maybe they fix it later but that renders it unusable for me. There is also no way to update a page because after the publishing the link is lost and there is no way to retrieve a post from the blog.

I would expect that there is a flag that allows me to post in Markdown and a way to list all my posts so that I can update their content because I post in Markdown. Right now I am better off using MarsEdit on the Mac and Post on iOS. I don’t mind spending $5 on a good add-on but this is just half-done with link bloggers in mind.

For now I give two thumbs down for the Byword Premium even though I enjoy the App and I am willing to spend money on good updates. That said the Publishing is not well done or designed.

Original

This is my first test to see how the Blogging Support from ByWord Premium works and if it is usable for my purposes. I am mostly concerned if they do send the plain Markdown text over or if they convert it to HTML which would make it completely unusable for me.

Let’see – Andy

13
Apr

Markdown, Syntax-Colored Source Code

In this post I want to see if I can use Markdown and Blog Text in order to have syntax colored source code.

Source Code

This is an inner Java Class:

private static class LogLevelConfig {
    private LogLevel mLogLevel;
    private Pattern mModelIdGlobPattern;
    private Pattern mModelTitleGlobPattern;

    public LogLevelConfig( String pModelIdGlob, String pModelTitleGlob, String pLogLevel ) {
        if( pLogLevel == null || pLogLevel.trim().length() == 0 ) {
            mLogLevel = LogLevel.debug;
        } else {
            try {
                mLogLevel = LogLevel.valueOf( pLogLevel );
                LOG.info( "activate(), given log level found: {}", mLogLevel );
            } catch( Exception e ) {
                throw new IllegalArgumentException( "no log level found for: '" + pLogLevel + "'" );
            }
        }
        if( pModelIdGlob != null && pModelIdGlob.trim().length() > 0 ) {
            mModelIdGlobPattern = Pattern.compile( pModelIdGlob );
        }
        if( pModelTitleGlob != null && pModelTitleGlob.trim().length() > 0 ) {
            mModelTitleGlobPattern = Pattern.compile( pModelTitleGlob );
        }
    }

    public LogLevel getLogLevel() {
        return mLogLevel;
    }

    public boolean matchWorkflowModel( WorkflowModel pWorkflowModel ) {
        boolean lReturn = true;
        if( mModelIdGlobPattern != null ) {
            lReturn = mModelIdGlobPattern.matcher( pWorkflowModel.getId() ).matches();
        }
        if( mModelTitleGlobPattern != null ) {
            lReturn &= mModelTitleGlobPattern.matcher( pWorkflowModel.getTitle() ).matches();
        }
        return lReturn;
    }
}

This is now the same code in Markdown:

private static class LogLevelConfig {
    private LogLevel mLogLevel;
    private Pattern mModelIdGlobPattern;
    private Pattern mModelTitleGlobPattern;

    public LogLevelConfig( String pModelIdGlob, String pModelTitleGlob, String pLogLevel ) {
        if( pLogLevel == null || pLogLevel.trim().length() == 0 ) {
            mLogLevel = LogLevel.debug;
        } else {
            try {
                mLogLevel = LogLevel.valueOf( pLogLevel );
                LOG.info( "activate(), given log level found: {}", mLogLevel );
            } catch( Exception e ) {
                throw new IllegalArgumentException( "no log level found for: '" + pLogLevel + "'" );
            }
        }
        if( pModelIdGlob != null && pModelIdGlob.trim().length() > 0 ) {
            mModelIdGlobPattern = Pattern.compile( pModelIdGlob );
        }
        if( pModelTitleGlob != null && pModelTitleGlob.trim().length() > 0 ) {
            mModelTitleGlobPattern = Pattern.compile( pModelTitleGlob );
        }
    }

    public LogLevel getLogLevel() {
        return mLogLevel;
    }

    public boolean matchWorkflowModel( WorkflowModel pWorkflowModel ) {
        boolean lReturn = true;
        if( mModelIdGlobPattern != null ) {
            lReturn = mModelIdGlobPattern.matcher( pWorkflowModel.getId() ).matches();
        }
        if( mModelTitleGlobPattern != null ) {
            lReturn &= mModelTitleGlobPattern.matcher( pWorkflowModel.getTitle() ).matches();
        }
        return lReturn;
    }
}

How I did it

First I must make sure that Markdown is ignoring my Blog Text Code snippet by enclosing the entire Code into a <div> block and then use the Blog Text syntax to define the code block which is are 3 cutely brackets together with the attribute lang defining the source code language for the Syntax Coloring. When I wanted to display the Markdown version of the Source Code I had to use the Blog Text No-Parse tags (two curly brackets followed by two exclamation marks). But if I use Blog Text then I will use only Blog Text for source code and not both.

The only downside of that all is that Markdown preview displays just a blob of text. Still the code is not infused with HTML making it impossible to read and without the additional work to convert the code every time to HTML.

— Andy

8
Apr

Moving Home of this Site

Since a while I am contemplating to move away from Bluehosst.com because of various issues but mostly because I am having issues with connecting to the Mail Server from time to time and this is plain annoying. A little bit of an effort on their site would made have stayed but I got more or less no help.

A New Web Site Host

Since I started looking I never found a good host. Next week my hosting at Bluehost.com was up for renewal and so I was finally forced to act. Initially I tried out Squarespace.com but their support of handling Source Code was not really good and neither Markdown nor BlogText was really supported and I was not inclined to use a special text component to display source code.
So last Week I got a notice from my registrar Register4Less that they offer Web Hosting that would fit my need. Because time was of the essence I ordered their hosting for a year. Then I wrote down what had to be done to move:

  1. Backup WordPress using the Dropbox backup
  2. Upgrade WordPress to the latest version
  3. Download the WordPress files from Bluehost
  4. Export the DB using phpAdmin
  5. Uploading the WordPress files to Register4Less
  6. Create the MySQL DB
  7. MySQL Admin and WordPress User and give them the right permissions
  8. Import the WordPress Export
  9. Change my local /etc/hosts to test
  10. Test the WordPress Site
  11. Undo the /etc/hosts changes
  12. Create the Email Accounts
  13. Transfer the Emails using imapsync using MacPorts
  14. Testing the Emails on the new Server
  15. Create / Adjust the DNS Settings at Register4Less
  16. Change the DNS Name Servers at Register4Less for my Domain
  17. Test the Life WordPress Site and Email Server

I expected that this would take the entire weekend to accomplish. But because the setup at Bluehost and Register4Less are so similar (both use Linux, cPanel, FTP etc) I was done within about 9 hours which is lightning fast.

Pitfalls

The first problem I caused myself was when I through that I had to change the Domain Name inside the WordPress DB records until I realized that using /etc/hosts was much easier. Then I had some issues with imapsync and because I did not want to pollute my Mac Box I used a VMware Fusion virtual machine to install MacPort and imapsync. It was slower but if anything went wrong because of the MacPorts etc I could just ditch the virtual machine. At the end everything ran smoothly and straight forward. Finally the change of the DNS entries took some time because of an initial misconfiguration and then I had to wait until the previous settings finally expired (3h TTL).

Result

Best result is if nobody would notice and so far I looks good based on my initial smoke screen tests. I am still expecting some issues but so far I was impressed how easy and fast it was. WordPress, MySQL / phpAdmin and cPanel are really easy to do a move like that. Let’s cross our fingers that the Mail Server problems are a thing of the past to make the effort worthwhile.

At the end I want to thank Dough from the Register4Less Support team for his help otherwise this would have been a way longer story.

— Andy Schaefer

30
Mar

Markdown, Quotes and Source

Another little thing that I did not know about Markdown is to write quotes and source code.

In all IT there is always someone smarter than the smartest one you know
and always someone dumber than the dumbest one.

Me

Here is some Java code:

public class Test {
    public statif voir main( String[] pArguments ) {
        // doing nothing as usual
    }
}

Have fun – Andy

29
Mar

Markdown and Images

As mentioned before I am still figuring out how to make Markdown work with MarsEdit and my WordPress blog. The last big issue is how to deal with images. Images in Markdown are simple by just adding an exclamation mark in front of the Image URL.

There is an image of my new back Pepple Watch which is got last week.

So far the workflow was:

  • Open MarsEdit

  • Open Media Manager of MarsEdit (not really necessary but helpful)

  • Open Upload Utility

  • Drag an Image from the Media Manager onto the Upload Utility

  • Adjust the properties and upload the file

  • Go to WordPress, Media Library and obtain the URL to the image

  • Add it the post

It would be nice tough if MarsEdit could do everything from within the Media Manager. On the Media Manager below the Image properties should be a button to upload the image and on then on the Published Image there should be a right-click context menu entry that would provide the URL for it. That would make it a two step process.

Cheers – Andy

29
Mar

First Step with Markdown

Update: after making the decision to go with Markdown and installing Markdown on Save Improved Plugin for Workdpress it was pretty easy. The only thing to remember is to add two spaces at the end of a paragraph to end that paragraph and not to forget to add the reference links at the end of the document. I could also preview the page as formatted Page in the MarsEdit Preview Page when selection the Markdown Filter at the bottom.

After buying and reading MacSparky’s Field Guide to MarkDown I wanted to see how difficult it is to use Markdown together with MarsEdit to write my posts and WordPress on Madplanet.com. There are few things that I am not sure if it works:

1) Using Markdown on future Posts but using Blogtext on my older Posts
2) Using Links within a Post
3) Displaying Source Code
4) Integrating Images

So far I am pretty happy if I just can use Markdown for simple posts now and later us it more advanced posts or tutorials.

Cheers – Andy

19
Aug

Pelican: Another Way for Madplanet.com Inc. Site?

Lately Bluehost.com gives me some grief and so I am thinking about changing my provider.
So I started to think that maybe this would be a good opportunity to also switch from WordPress to an easier setup.
What I would like to do is to use Markup to write by posts and pages but also wanted to see
if it is possible to avoid having to deal with a DB. Not that I hate to use a DB but backing
up the data and exporting the content is not that simple. But then again what should I use and is it ready worth the effort.

Then I found this page from [http://www.macdrifter.com/2012/08/pelican-guide-moving-from-wordpress-and-initial-setup.html|Macdrifter] talking about Pelican which would just do that.
But instead of plunging right into it I wanted to do an intermediary step by having the Site
first running on my local Mac (Apache, Python already there) and when it is working as expected
I will go ahead and push the content from my Mac to the ISP.

First step was to just get Pelican installed and up and running before going ahead.
Afterwards I would recreate Madplanet.com’s website on my local Mac so that I don’t have
to bother my ISP or damage the installation. From there I will migrate the content over
and when it is done I will push the content out and pull the plug on the old site.

Pelican Installation

To my surprise the installation and configuration of Pelican was straight forward:

sudo -s
easy_install markdown
easy_install pelican
easy_install pygments

mkdir /Library/WebServer/Documents/pelican

pelican-quickstart

Now don’t waste too much time on the questions. Just answer what you can and leave the rest
blank or accept the defaults. It is only generating a configuration file for most parts.

The only important thing is that the location for pelican is at the previously created
directory (/Library/WebServer/Documents/pelican). You can select any directory you
like but this is the default given by Apple and so I used this.

Apache configuration

The Apache Configuration can be different on every computer and so here I only describe
the simplest solution to set Pelican to be the root document root. For that I just set
the Apache Document Root to the Pelican’s Output directory:

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Library/WebServer/Documents/pelican/output"

and then define that Directory:

<Directory "/Library/WebServer/Documents/pelican/output">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks MultiViews

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

Last two steps are to check if the configuration is OK and then restart the Apache server:

sudo apachectl -t
sudo apachectl restart

See Pelican in Action

Before we can go ahead we need to generate the site in Pelican. For that we go to the
project’s home directory (/Library/WebServer/Documents/pelican) and use make to generate
the site:

cd /Library/WebServer/Documents/pelican
make pelican

Finally we can open the site with this url: localhost.

Conclusion

I am not done here by a long shot. First I need to have both the WordPress and the Pelican
site running on my Apache Server and then I need to export my WordPress site and install it
locally. But for now that’s all.

– Andy

25
Oct

MarsEdit, WordPress and BlogText All In One

Today I wanted to see if I could use MarsEdit and BBEdit to post a Post or Page to this WordPress site using BlogText plugin for WordPress.

BlogText is a simple markup language so that I don’t have to write HTML in order to post a Blog. Now with the HTML editor of MarsEdit that maybe isn’t necessary but I am going to edit the posts / pages through the Web Interface or iOS App and then I want to make it as quickly as possible.

Initially I ran into a lot of issues because MarsEdit did create HTML around the BlogText effectively rendering BlogText mute. Then I tried to use the HTML view and voila it would send the content as is. So I changed the default editor back to the HTML editor and now I can edit my posts like this one with BBEdit using BlogText through MarsEdit.

BTW I like MarsEdit because it is faster to navigate and has a better overview than the Web interface of WordPress.

– Andy´╗┐

29
Aug

Busy Weekend Fixing Stuff

On Friday something very strange happened – when I read an email from my company mail server all mails from the INBOX just disappeared. My wife still had hers and so when I checked out the OS X Lion Server I saw that Dovecot’s cur directory was empty but emails were inside a new directory called extra-cur. Because I could not figure out how to transfer back and my mail server setup was screwed anyhow I re-installed and setup the server from scratch again and now mail is working fine again with all bells and whistles.

On a side thing I discovered how to setup a web site with WordPress and how to use a Markup plugin (BlogText) so that I can also have my wiki on WordPress as well. This means it would be dead easy to manage my site having only to deal with WordPress. But then I thought that I might want to stop dealing with my own Site and hand this over to a hosting company. Beside the emails there is nothing confidential on our site and emails are not secure at all so handing over the hosting of the site to another company is not only freeing myself from having to deal with setting up my own server but also saves a ton of money.

Because we are moving in 2 or 3 weeks I want to make the switch beforehand. This means that I have to convert / adjust our website which needed an overhaul for quite some time, move over the XWiki content which is harder to do because of the number of pages and images and finally to setup the site so that the old links are still working (at least for all the content that wasn’t retired).

– Andy

26
Aug

Sorry for the Mess

Working on another WordPress project I finally realized that the link of my theme sends the users to a spam page. Checking out WordPress I could not find the theme anymore and so, I guess, they pulled it because of that. Because I am not going to allow anyone to use my blog to distribute spam I am not going to allow this even with the theme I am using. Therefore I searched for a new theme and found this one which seems to be nice and because I am a little bit in a pickle I went with it. I’ll see this weekend if I am sticking with it and what changes I want to add to it.

Again, sorry for the mess – Andy Schaefer