Updates

Pharo Starter Scripts

The https://github.com/jborden23/PharoStarterScripts repository contains several scripts used with Pharo, while I still use Pharo Launcher, there are some reasons not to:

  • It writes to ~/Documents, on my Mac this is takes iCloud storage
  • I've had problems starting it on Fedora, it doesn't seem reasonable for a Raspberry Pi

There are several projects similar to this:

The goal is to eventually improve the scripts used on https://pharo.org/download.

Posted by John Borden at 18 January 2020, 2:17 am with tags Pharo link

Committing Pier-Seaside in Iceberg

Working on the code for Pier Table of Contents, found that it can be resolved by defining:

PRTocRenderer>>start: anObject in: aComponent on: aRenderer
	self component: aComponent.
	self renderer: aRenderer.
	self start: aComponent owner

This is the same as version it its grandparent PRRenderer, except the start is sent anObject (aCompoent is the value:toc link). This code is loaded on this wiki (which is why the table-of-contents is displayed correctly from the main blog.

Committing the code to GitHub hasn't been as easy as expected. Steps taken:

  1. Using Pharo 7 and installing Pier (like Loading Pier 3.2 into Pharo 7), but using the NewDev branch instead of master:
    Working copy of Pier3
  2. Modify the code and use the git username as the author (not certain if this is required).
    Browser for adding method, Author identification
  3. From Iceberg, the Pier3 repository is green, indicating that it has changed. Open the packages to verify that pier-seaside is modified. Choose the option to commit the change.
    Commit on Pier3 branch NewDev
    It is also possible to commit in one step and push in a second, but that doesn't change the results of this.
  4. After clicking Commit, a status bar shows that it is committing and then pushing; however the comment is cleared out and it returns to the same screen:
    A comment for your commit.
    Reloading the code does not show that it was modified.
Found that renaming the package pier-seaside to Pier-Seaside resolved the problem, but it required adding another code change (like a class comment) to make it write-able from Iceberg.

Posted by John Borden at 2 January 2020, 3:39 am with tags Pier link

Pier Table of Contents

Pier Table of Contents Contents:


Problem Description

Pages in Pier can have a table-of-contents based on the header items (such as Problem Description on this page). Another TOC is at the top of this page.

As pages get larger, it makes sense to break them up into both separate pages as well as sections with their own heading. Unfortunately the TOC widget doesn't always work for the page that it calls home.

Large Page Example

Consider the following large page:

*value:toc*
!Problem Description
Text
!!Sub Problem
Text describing what else is wrong.
!!Another Related Problem
Text and links to different problems
!Failed Solution 1
What didn't work
!Failed Solution 2
What else didn't work
!Working Solution
The quick answer.

If Problem Description needs to be broken into another page with the sub-problems, it would be useful to have a way to step into the sub-problems in the table-of-contents.

Existing Behavior

Unfortunately when a page is broken up, a TOC on a sub-page when embedded in the larger page does not display the TOC for the sub-page. If the large page example above is broken up as:

*value:toc*
!Problem Description
*Problem Description|embedded=true*
!Failed solution 1
What didn't work
!Failed Solution 2
What else didn't work
!Working Solution
The quick answer.

With the page Problem Description having:

*value:toc*
Text
!Sub Problem
Text describing what else is wrong.
!Another Related Problem
Text and links to different problems

Then the page will be displayed as:

  • 1 Problem Description
  • 2 Failed Solution 1
  • 3 Failed Solution 2
  • 4 Working Solution

Problem Description

  • 1 Problem Description
  • 2 Failed Solution 1
  • 3 Failed Solution 2
  • 4 Working Solution

Text

Sub Problem

Text describing what else is wrong.

Another Related Problem

Text and links to different problems

Failed Solution 1

What didn't work

Failed Solution 2

What else didn't work

Working Solution

The quick answer.

The problem is that the TOC is listed twice because the PRTocRenderer runs over the main page twice.

Failed Attempt

A first attempt was to update the renderer to always assign visitors to start on their owner. This caused a walkback on displaying a simple page.

Another Solution

Another attempt was to add PRTocRenderer>>start:in:on: so it starts on the in: argument's owner and ignores the original start argument. So far the test pass and pages are displayed correctly.

Posted by John Borden at 24 December 2019, 4:52 pm with tags Pier link

Raspberry Pi Updates

While working on Pharo on a Raspberry PI, noticed that the OS version was quite old:

pi@raspberrypi:~ $ cat /proc/version
Linux version 4.14.52-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1123 SMP Wed Jun 27 17:35:49 BST 2018

After searching around, found the official RP site and ran these commands:

sudo apt update
sudo apt full-upgrade

Seems that vcgencmd should only be used to update when there is a reason, not just regular updates.

Posted by John Borden at 15 December 2019, 2:18 am with tags RaspberryPi link

Link Labels in Pier3

While working through a large Pier migration, I found several problems:

  • When starting the old Pharo version 6 image on a Pharo 7 VM (what I on-hand), it started fine but gave an error for missing the version 6 sources file. When it got to the part of exporting the kernel users, it had a failure based on compiling code (more than 64 temporary variables, my wiki has around 130 users) in PRKernelCreatorForPier>>addUsersToKernel:. After copying the version 6 sources to that directory, restarting the export was successful for the users.
  • Found that several of the old pages had links like:

    Text *label with star {{{html: *}} in it>http://www.google.com*

    This fails in PRPillarParser>>linkAlias with each start being nil:

    	each start: each start + anArray first start - 1.

    Creating the same text in a new 3.2 wiki produces the same failure. The wiki text needs to be replaced with:

    Text *label with star \* in it>http://www.google.com*

  • Once logged in, one of the possible views is Text which displays the page as plain text. This doesn't seem very useful, and currently it fails with the error:

    MessageNotUnderstood: GRPharoUtf8CodecStream>><<

    Its possible to add this, or to have another work-around, but there is a Wiki option which displays the page in wiki syntax, which makes this feature seem to be duplicate, so removing the PRPlainView class to remove the option.

Posted by John Borden at 12 November 2019, 3:53 am with tags Pier link
<< 1 2 3 4 5 6 7 8 9 10 >>