Since your driving a single 7 segment, you can cheat with a lookup table. Consult the instructions for whatever language you're programming in, nearly all of them have a lookup table function. Assign values provided by Carl's truth table to the lookup table's index positions 0 through 9. Then it's a matter of choosing the number you want, grabbing the appropriate binary code from the index position from the table and shifting it out to the '595.
In Proton Basic:
' index positons equal decimal value you want to display
' I'm going with LSB = 0, but it doesn't matter
' I didn't put all the values in, just 0, 1, 2 and 3
Segments = LookUp IDX, [252, 96, 242, 182]